How to select all records?

elmop2005

New member
Local time
Yesterday, 16:02
Joined
Feb 9, 2012
Messages
8
Hi,

i need to select all records and delete them but i dont know how to select al or delete all, i have working code to delete one record within the form but cant delete all, his has caused me problems for a while now.

this is the code to delete one record:

Private Sub DeleteOrderbtn_Click()
On Error GoTo Err_DeleteOrderbtn_Click
Err_DeleteOrderbtn_Click:

DoCmd.RunCommand acCmdSelectRecord
If MsgBox("You are about to delete this order. Do you really want to do this?", vbYesNo + vbCritical + vbDefaultButton2, "Warning") = vbYes Then
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True

Exit_Deletebtn_Click:
Exit Sub
End If
End Sub

thanks for any help
 
Look at "DemoDeleteRecA2000.mdb" (attachment, zip).
Look at Table1, Form1. Open Form1 and try.
 

Attachments

for some reason the file doesn't open properly. i have tried extracting to desktop as well but opens blank even after enabling content
 
You don't need to delete from the form's interface. Delete using a DELETE QUERY and filter it using the form's Filter method. That method contains any filter you applied to the form when it was opened.
 

Users who are viewing this thread

Back
Top Bottom