MS Access "Auto Exec"

Richard Korts
Richard Korts used Ask the Experts™
on
I know there is a way to run a macro (or query) automatically when an Access database is opened.

I know there is a way to open an Access DB with an Auto Exec Macro and NOT execute the macro; I can't remember how?

How can I edit the Auto Exec Marco to change what it does?

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Yes. You can execute your own macro when the Access Database is opened.

Here you go,

http://office.microsoft.com/en-in/access-help/create-a-macro-that-runs-when-you-open-a-database-HA010341574.aspx
OK, and the question how to skip it...
the SHIFT key...
See here:
http://access.mvps.org/access/api/api0068.htm
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010

Commented:
to bypass the macro or automatic opening of the "Display Form" (the form that is automatically opened at startup, which is set in the Access Options -> Current database), hold down the shift key as the database opens.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Richard KortsBusiness Owner / Chief Developer

Author

Commented:
If there is an AutoExec Marco, is iit called "AutoExec" or something like that?

Thanks
If it is an AutoExec Macro (and not auto statup form) then there is should be one, yes...
Another article for you.:
http://support.microsoft.com/kb/826765
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
Top Expert 2007

Commented:
"I know there is a way to run a macro (or query) automatically when an Access database is opened."

It's a macro you create to do whatever - with a very specific name:
AutoExec

AutoExec macro
"I know there is a way to open an Access DB with an Auto Exec Macro and NOT execute the macro; I can't remember how?"

When you open the database, hold down the Shift key - until the db is completely opened. This will bypass the AutoExec macro (and/or any start up Form - as mentioned by fyed).  You will now able to edit the AutoExec macro.

Note that ... if this is not your db. it's possible that the Shift Key bypass has been removed, which then requires additional steps to get into the db.

mx

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial