Close Acces Event

miramax

New member
Local time
Today, 12:38
Joined
Apr 19, 2001
Messages
8
Hi guys,

Could someone tell me if there is a Close Application EVENT for Access. I just want to execute a numer of things via VBA when the user tries to close the application. There is one for Start Up, but I still have not found an equivalent when the user Closes the Application.

Any comments and advice will be appreciated!

Thanks
 
Maybe use a form with a command button to close the app and enter your code in the OnClose event of that form. Or have a hidden form and put the code there, because when the app closes, it also closes the form.
 
The problem is that If the user closes the databse by clicking on the highest Close button (the one for Access), the Close event for the open objects do not trigger....Thanks however
 
The easy way is to set your form to maximize and pop up which will cover the Access toolbar or you can add code to a form to prevent users from exiting via x.
HTH
 
Rich, I do not think that it is possible to cover the Access close button with a forme...How can you do this?

Regarding the code that I can write..can you be more precise...

Thanks!
 
In the form's property sheet set pop up to yes, or if you set the forms modal property to yes your users will not be able to access the x or the toolbars.
HTH
 
Hi Rich! Thanks very much for the advice! I've tried it and it works! Great!

Have a nice day/evening!
 
This is rather strange; I've tested it and I find that code in the OnClose or OnUnload events for a form will run whichever way the form is closed, including:

-Closing the form with the X button on the form
-Quitting or closing in code
-Switching from From to Design view
-Closing Access using the top right-hand X

So I'm a little puzzled, under what scenario does it not run the code?

Mike

[This message has been edited by Mike Gurman (edited 05-04-2001).]
 

Users who are viewing this thread

Back
Top Bottom