Can you give me a time index? That's a long lesson. I haven't watched most of these since they were first recorded, years ago. I'll have to rewatch that section to get familiar with the material I was covering.
Kevin Robertson
@Reply 19 months ago
You could add a ToDelete field (Yes/No) to the Table and only delete the records where the value is set to True.
I also added an 'Are you sure' as I do with any DELETE operation.
I called the Renumber Sub so the records are renumbered in one step.
If MsgBox("Are you sure you want to DELETE the selected contacts?", _
vbYesNoCancel + vbCritical, "Confirm Delete") = vbYes Then
CurrentDb.Execute "DELETE FROM ContactT WHERE ToDelete=TRUE"
Me.Requery
Renumber
End If
John SchreiberOP
@Reply 19 months ago
This was a very long lesson. Start about time 25 when you are talking about deleting multiple records and go to the end. You were not successful in trying to delete multiple records the way you wanted to. Over the time from 20 something to the end you showed many trials and error tests but did not completely get what you wanted. Therefor my suggestions.
Just realised, the records don't get deleted the first time you hit the button. You have to click a second time.
You need a Me.Refresh before the code I posted above.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Developer 22.