Once you have everything ready and have planned ahead, you can create a macro by clicking on the “Create” tab in the MS Access database window, which displays the macro icon on the far right. (See screenshots below.) Clicking on the macro icon opens a dialog box where you order up your steps in the left “Action” column. You choose from an array of actions from the drop-down menu. The middle “Arguments” column are details for a particular action. For example, if the Action is “OpenQuery” the arguments would include, naturally, the name of the query, the view you want it to open in, etc.
Let’s do a basic, easy macro: Say you want your database to open with a specific form displayed. You want the form to be opened where you can edit or add a new one. So under “Action” you select “OpenForm”; in the Action Arguments section you select the form from the drop-down list. (The form is there because you created it previously.) Then you select “Edit” from the Data Mode and “Normal” from the Window Mode.
The final step is to name and save the macro. This one we will name “AutoExec.” This will be the default macro that your database opens with every time.