-
I have a small program that uses a .mdb database and have them connected with a data1 object. I have a command button on the form that is = to data1.recordset.addnew. If you click the add new button and add a new record then click it again to add another one. then click the data1.recordset.delete command button it will delete the current record and the original record you started on. I think I need some more code in the add command . I hope you can help me and that I am clear enough.
Thanks Alot,
-
recordset.Delete
recordset.MoveFirst
recordset.Delete
data.Refresh
or
recordset.Delete
recordset.Seek "=",the key of the record to be delete
recordset.Delete
data.Refresh
Hope it helps
-
I take it you want to delete multiple records...
if so, then try this...
code...
Set rst = dbs.OpenRecordset("SELECT * FROM rst _
WHERE rst.fieldname = '" & variable & "'", dbOpenDynaset)
dbs.Execute "DELETE * FROM " _
& "rst WHERE rst.fieldname = '" & variable & "'"