Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete Record +DAO

Status
Not open for further replies.

davetek

Programmer
Oct 30, 2002
42
IE
Hey,

I'm trying to do a basic delete query using DAO....
can anyone see where i'm going wrong...

Dim dbs As Database, rst As Recordset
Dim ssql As String

Set dbs = CurrentDb

ssql = "delete * from Tbl where key = '1';"

Set rst = dbs.OpenRecordset(ssql)

rst.Close

dbs.Close

cheers...
 
You can make this a bit shorter:

Dim dbs As Database
Set dbs = CurrentDb
dbs.Execute "DELETE * FROM Tbl WHERE key = '1';"



DBAMJA

It is said that God will give you no more than you can handle. I just wish God didn't have so much faith in me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top