Designing a Macro in Microsoft Access

Ask us a question on-line
or get our email address on scr.im

Access Programmers has a mission to help people improve productivity through the effective use of technology.

 

 

Microsoft Certified Partner

  

Designing a Macro

When you open the Database Window, select Macros under Objects and click on the New button.

Create a new Macro

The following Macro window screen should appear. 

new Macro screen

In the Action column, click the arrow to display the list of available actions and select the action you want to use. There are several dozen actions to choose from. Depending on the action selected, you may have to specify Action Arguments in the lower part of the window. For example, if you select the OpenForm Action, the following Action Arguments appear in the lower part of the window for input.  

OpenForm action attributes

GoToRecord action attributes

If you want to add more actions to the macro, move to another action row and select a new action. Note that Microsoft Access carries out the actions in the order you list them.

Comments for the action are optional.

To save the macro, click on the "Save" icon and enter a name for your macro. Make sure you name this macro "Autoexec". By naming it Autoexec, Access will run this macro every time the database is opened.  

Save your new Macro as

Note:  If you want to insert an action between two existing action rows, click the selector for the action row just below the row where you want to insert the new action and then click Insert Row Insert Row on the toolbar.