MS ACCESS - How can I get a Macro to Auto Run When Database Open + Closes ???
Hello,
Can anyone help ?
I need to Automatically Run a macro when the database opens and Closes ???
Any Ideas ??
Re: MS ACCESS - How can I get a Macro to Auto Run When Database Open + Closes ???
If you name a macro:
'AutoExec'
it will run each time the database starts.
on close, if you have an exit button:
Code:
docmd.RunMacro "AutoExec"
Re: MS ACCESS - How can I get a Macro to Auto Run When Database Open + Closes ???
Ewww macros :p
VBA coding however ...
Have a splash screen (form) and a background form.
Tools>Start up options to get the splash screen form to open, in the OnLoad event run other code and open the background form (which is tiny and made invisible).
The closing code then goes in the close or unload event of the background form which then is run as the db is shut.
Its another option...
Re: MS ACCESS - How can I get a Macro to Auto Run When Database Open + Closes ???
Quote:
Originally Posted by Ecniv
Have a splash screen (form) and a background form.
Tools>Start up options to get the splash screen form to open, in the OnLoad event run other code and open the background form (which is tiny and made invisible).
The closing code then goes in the close or unload event of the background form which then is run as the db is shut.
background forms can also be used for other tasks so it would be a good idea to implement. :thumb:
I use one which contains a timer loop and a flag check to allow me to log all of the users out of the database for maintenence. :D