Close form

  • Thread starter Thread starter WH
  • Start date Start date
W

WH

Guest
I want the same closing event in my forms as they are used in MS-excel and Word:

One closes (by button) a form. The click-Button_Event checks if there were any changes in the fields. IF so question;"do you want to save the changes" Yes/No/Cancel Buttons. If There were no changes: close form.

Who can help me!!!
 
Look for help on "dirty".

Ex:
If Me.Dirty Then
If Msgbox("Save Changes?", vbYesNo, "Save?") = vbYes Then
DoCmd.Close
Else
Me.Undo
DoCmd.Close
End If
Else
DoCmd.Close
End If



[This message has been edited by scottfarcus (edited 03-21-2002).]
 

Users who are viewing this thread

Back
Top Bottom