Hi,
Quick question..
What code should there be between DoCmd.RunCommand acCmdDeleteRecord AND DoCmd.Close
If I don't enter any data I get a msg "Record cannot be deleted at this time.."
so I need a code that on error would cancel the event and carried on with closing the form.
This is the whole code:
Private Sub Exit_Click()
On Error GoTo Err_Exit_Click
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.Close
Exit_Exit_Click:
Exit Sub
Err_Exit_Click:
MsgBox Err.Description
Resume Exit_Exit_Click
End Sub
Thanks!
Quick question..
What code should there be between DoCmd.RunCommand acCmdDeleteRecord AND DoCmd.Close
If I don't enter any data I get a msg "Record cannot be deleted at this time.."
so I need a code that on error would cancel the event and carried on with closing the form.
This is the whole code:
Private Sub Exit_Click()
On Error GoTo Err_Exit_Click
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.Close
Exit_Exit_Click:
Exit Sub
Err_Exit_Click:
MsgBox Err.Description
Resume Exit_Exit_Click
End Sub
Thanks!