Reputation: 903
I have a form like so :
When I select multiple rows I want my delete button at the footer of the form to delete all the records I have selected. It just ends up deleting the first row I selected. Trying to research vba code for functions that gets the selected records, and all i came across was,
DoCmd.RunCommand acCmdDeleteRecord
That doesn't choose all the selected entries. Any way to do this?
Upvotes: 2
Views: 3123
Reputation: 2059
Keep in mind that you can delete records one-by-one without code by clicking on one record's record selector (gray rectangle to the left of each client name) and pressing the delete key. You can do the same with multiple adjacent records. If you want to delete multiple non-adjacent records, you need to make a big change: adding a field like chkDelete to the source table and adding a bound checkbox. With that built, you can call a delete query that deletes all rows where chkDelete=True.
Upvotes: 3