On Quit Event?

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

I have some code which is intended to run when the user
quites the application, which is fine if he, or she, uses
the "Exit Database" button I have provided, but several
people seem intent on using the application's close
button at the top right of the screen and bypassing my
code. Is there a way to run code when the user quits the
application (by whatever method) or can I disable the
applications close button?
 
Have a variable set up in the declarations section at the
top of the form ie, bShutDown and set it to false in the
Onload event. Then in the Unload event, check if it is
false and if so, cancel the Unload (with a msg). Then in
the ShutDown Button, set it to True when the user clicks
on it. OR, put all your code in the the Unload event
anyway, so that it will run without bothering about the
above.
Max
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Access 'Quit' event 7
Exiting Access 4
Trapping Application Exit 2
Quit Access 2
Events as the DB closes 4
Compact On Close 1
Can we remove the Close button of Access? 1
Procedure at Access Stutdown 7

Back
Top