On Quit Event?

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?
 
M

Max Sherman

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


Top