How can I have the form undo any changes when the form is closed? See, I have a save button which saves the data. I want the close button to NOT save the data, but undo any changes. How do I do this?
To be informative and gracefull, notify user that they have changed data on the form and may not Close form until saving or rejecting changes. Your Save button saves the data and allows record validation, force your users to use it! Close button should only close when you want it to! Do a Close click event like this:
Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click
If Not Me.Dirty Then
DoCmd.Close
Else
MsgBox "Save record before closing form!,vbOKOnly,
"Record is not saved!"
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.