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
 
Back
Top