Quick summary
An AutoExec macro in Microsoft Access runs automatically every time a database is opened, making it ideal for automating startup tasks. By naming a macro exactly AutoExec, Access recognizes and executes it without any manual trigger.
Steps
- Go to the Create tab in the ribbon.
- Click on Macro in the Macros & Code group.
- In the macro design window, use the drop-down in the Action column to select the actions you want the macro to perform.
- Configure each action's properties as needed.
- Click the save icon to proceed.
- Name the macro AutoExec — this name is mandatory for it to run automatically — then click OK to save.
- Close and reopen the database, then click Run to verify.
- The AutoExec macro will now run automatically each time the database opens.



