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
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