"AutoClose" macro in Access

H

Helge V. Larsen

Excel has Auto_Open and Auto_Close VBA routines that are automatically run
when the workbook is opened and closed.

Access has an AutoExec macro that is automatically run when the database is
opened.
I need an equivalent "AutoClose" macro in Access - but this option does not
exist.

How can I run a macro or some VBA code when a database is closed ?
 
H

Helge V. Larsen

I am developing an application that is used/tested by several others. The
general users/testers need some buttons on a toolbar that is part of the
application. But during the development I need some more buttons. These
buttons are added to the toolbar when the application is opened - if
Environ("USERNAME")=<My usercode>. When the application is closed I would
like to remove them again - if Environ("USERNAME")=<My usercode>.
 
B

Beth Melton

You could load a hidden form when Access starts and use its Unload
event to trigger your code. The way this works is if the database is
closed in any way the form will be unloaded.

Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/
 

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

Top