Below is the code for exiting without saving. It works perfectly fine. I just want to know if I can change the MSGBOX message to something like "Are you sure you want to exit without saving?" instead of its default message - "Are you sure you want to delete this record?
and also, right now, if I click NO when I am asked if I want to delete this record, it exit the form rather than staying in the same form.
But how do I make it to STAY in the same form if I click NO.
Thanks...
Code:
Private Sub Command24_Click()
On Error GoTo Command24_Click_Err
On Error Resume Next
DoCmd.RunCommand acCmdUndo
DoCmd.Close
DoCmd.OpenForm FormName:="fdlgSearchPatient"
If (MacroError <> 0) Then
Beep
MsgBox MacroError.Description, vbOKOnly, ""
End If
Command24_Click_Exit:
Exit Sub
Command24_Click_Err:
MsgBox Error$
Resume Command24_Click_Exit
End Sub