I want to add a message box(save or not) before closing a form in ACCESS. It seems like the default is save any change when closing a form. as long as user types anything in the form I can use acUndo to discard the changes without saving it. However it user only browse it, it gives me error message says the " action Undo is not available." How could I check if acUndo is available or not? acUndo always = 0.
here is the code,
Private Sub Form_Close()
'somecode here, if acUndo available...
If MsgBox("Do you want to save it?", vbYesNo, "Remind") = vbNo Then
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, acObjectVerb, acMenuVer70