The AutoExec macro is a special macro name that gets triggered every time an Access database is opened that includes one. This can be useful to control exactly what happens each time the database is opened. To bypass the AutoExec macro, users can simply hold down the shift key while opening the database file.
- [Narrator] There is one more way to trigger a macro…that you should be aware of,…and that's to do so automatically when the database opens.…I'm going to make a copy of the Morning Review macro…that we've previously created by right-clicking on it…and choosing Copy, and then right-clicking…in the All Access Objects navigation pane…and choosing Paste.…That'll allow me to give it a new name here,…and I'm going to give it a very special name called autoexec.…This is an abbreviation for auto execute.…I will press Enter and I will save it here…in the navigation pane.…
Anytime an Access database starts up…that includes a macro with this name,…it'll run the macro before performing any other tasks.…Let's go ahead and close down the database now…and test it out.…I get this prompt that the clipboard is about to be emptied…and that's totally fine.…I'll press the Yes button there,…and then I'll finish closing out of the database.…Then I'll simply start up the database again.…The file that I was working with was called…H+ Sport - Auto Execute,…
- Creating multi-step macros
- Triggering macros
- Running macros at startup
- Adjusting the execution and flow of macros
- Troubleshooting macros