For example, you could place the following code on the BeforeUpdate event for the form.
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim LResponse as integer Dim LMsg as string
LMsg = "Do you wish to save changes?"
LResponse = msgbox(LMsg, vbYesNo, "Save changes")If LResponse = vbNo then
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
End ifEnd Sub
In this example, before the changes are saved, the user is prompted with a message box. This message box asks the user if he/she wishes to save the changes. If the user responds "yes", then the changes are saved. If the user responds "No", then the changes are undone and the record is not updated.