Need code to run when closing application

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have code that I need to execute when the user quits the Access
application. I have the code in a module that is called when the command
button is clicked which is intended to be the exit point of the app.
However, if the user clicks the "upper right hand X" close button to quit, I
don't know of a way to detect this event. Can anyone tell me how this might
be done?
Thanks in advance.
 
Call the code from the Unload event of a form that is kept open all the
time. If you don't have a form that is kept open all the time, then open a
hidden one when you open your database. If needed, the unload event will
also allow you to cancel the close.
 
hi,
I assume that the command button which is intended to the
the exit point of the app is on a form. on the property
sheet of that form, you can set the close button property
to no. that will turn the X button on the form off ie
don't work no mo.
 
Will the hidden form's Unload event fire even when the user quits by using
the MS Access X button?
 
Back
Top