The autoexec macro is used to run actions when the database is opening. For example, you may wish to perform a data update before the system becomes active. You can do a similar thing with the start up options, but the autoexec macro will allow you to run more than one action.
Lets look at how we can use the autoexec Access macro to open a form and move to a blank record for entering data.
Load up a database.
Go into the macro designer.
In Access 2007 at the Ribbon you would click on the create tab.
Then click on the macro icon at the far right hand side.
In the action column select the ‘OpenForm’ action.
At the bottom of the screen you will see an area for action arguments.
Select the name of the form to open
Make sure the view says form.
Now select another action of ‘GoToRecord’.
At the bottom of the screen you will see an area for action arguments.
Select an object type of form.
The object name will be the form you are opening.
Set record to be new.
That’s it…..
Now just save the macro with the name of ‘Autoexec’.
Close the macro designer window.
Exit the database.
Now run the database.
The autoexec Access macro will immediately kick in and you will be taken to a brand new record in the form you specified.
The autoexec macro enables us to control what we want to take place when the database is opening.
Click here MS Access macro if you want to learn more about macros.


