On Close

D

DS

I want to add code that executes when my database closes. The database can
close from any number of places, so I would just like to add this globally
so to speak. Is this possible? If so where can I place this code without
having to add it to each and every from.
Thanks
DS
 
A

Allen Browne

DS said:
I want to add code that executes when my database closes. The database can
close from any number of places, so I would just like to add this globally
so to speak. Is this possible? If so where can I place this code without
having to add it to each and every from.

Since there is no application close event, the usual workaround is to open a
hidden form and use its Unload event.
 
M

Marshall Barton

DS said:
I want to add code that executes when my database closes. The database can
close from any number of places, so I would just like to add this globally
so to speak. Is this possible? If so where can I place this code without
having to add it to each and every from.


If the first thing your db does is open a hidden form, then
that form will be the last thing to close. You can then use
that form's Unload event (can be canceled) or Close event to
run your code.
 
D

DS

Thanks Marsh.
I'm using this to hide the mouse.
What happens if I don't do show mouse. It reappears when I close Access.
But is this bad. Since I'm hiding it do I need to reshow it?
Thanks
DS
 
M

Marshall Barton

DS said:
I'm using this to hide the mouse.
What happens if I don't do show mouse. It reappears when I close Access.
But is this bad. Since I'm hiding it do I need to reshow it?


I'm pretty sure that the mouse pointer is tied to the
applcation so whatever you do in Access should not affect
other programs.
 
Top