|
-
May 21st, 2000, 11:23 AM
#1
Thread Starter
New Member
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,
-
May 21st, 2000, 12:27 PM
#2
New Member
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
-
May 31st, 2000, 09:42 AM
#3
Lively Member
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 & "'"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|