Error with Delete Method - code check

Full_Williams

Registered User.
Local time
Today, 17:50
Joined
Jul 2, 2002
Messages
88
Hey there,

Can someone take a look at my code and let me know if they see anything wrong.

I'm getting a message that says:
"Update or CancelUpdate without AddNew or Edit"

Here's my code:

Set db = CurrentDb
Set rst1 = db.OpenRecordset("tblTable", dbOpenDynaset)

rst1.MoveLast
rst1.Edit
rst1.Delete
rst1.Update

It's actually deleting the record, but I don't know why I'm getting that message.

Thanks,
Full Williams
 
Full,

I don't know about your error message, but when you open
a table/query without an Order By clause, the records are
presented in random order. The last record in the recordset
may not be the last one entered or the last based on any
key field.

Wayne
 
take out the rst1.Edit line
 
Thanks Travis.

Got it to work. Had to take out the rst1.update as well.

I think with ADODB you need the .edit and .update just not with DAO.

Thanks again,
Full Williams
 

Users who are viewing this thread

Back
Top Bottom