Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save,Cancel,Delete,Close...

Status
Not open for further replies.

uncchcs

Programmer
Jun 4, 2002
13
US
I have a form with buttons where users can save,cancel,delete,create new, or close the form. What I want to do, is if the user attempts to close the form after changing data without clicking save, prompt them on close to accept or cancel changes. The same if they attempt to close with the close button. Anyone have any suggestions?

Jason
 
At your appropriate points put the following (or better still, make it a Private function and Call it from your appropriate points (so you only have the one piece of code)):

If Me.Dirty = True then
msgbox <with your prompt>
.... do whatever code or process you want here

End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top