Carry out an action when my database first opens
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
You can use a special macro named AutoExec to carry out an action or series of actions when your database first opens. When you open a database, Microsoft Access looks for a macro with this name and, if it finds one, runs it automatically.
- Create a macro containing the actions you want to run when you open the database.
- Save the macro with the name AutoExec.
The next time you open the database, Access runs this macro automatically.
- If you don't want to run the AutoExec macro when you open the database, hold down the SHIFT key when the database opens.
- You can also control how a database or application starts by setting options in the Startup dialog box (Tools menu). For more information, click .