Deleting a group of records in a Recordset

G

Guest

Hi. I am looking for help with deleting records from a recordset.

I have a recordset which is filtered and should only contain those records
the user "Marked" for deletion. How can I delete all the records from this
recordset easily. I hoping for a one-line command like rst.deleteall. I do
a lot of Foxpro programming and sometimes the difference between Access VBA
and Foxpro is frustrating.

Thanks so much for any help you can give.
 
A

AccessVandal via AccessMonster.com

KmhComputer said:
Hi. I am looking for help with deleting records from a recordset.

I have a recordset which is filtered and should only contain those records
the user "Marked" for deletion. How can I delete all the records from this
recordset easily. I hoping for a one-line command like rst.deleteall. I do
a lot of Foxpro programming and sometimes the difference between Access VBA
and Foxpro is frustrating.

Thanks so much for any help you can give.

Well, with wizard you can create a command button on your form
to delete a record, but you will need to edit VB.

delete away this,
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

insert this,
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSelectAllRecords
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top