Home » Microsoft Access » 11 - Miscellaneous
11

Creating a Macro

You can create a macro to perform a specific action or a macro group to perform a series of actions.

To create a Macro:

1. In the Database window,click Objects > Macros.

2. Click New on the Database window toolbar.

3. Add an action to the macro.

To add an action to the Macro

  1. In the Macro window,click the first empty row in the Action column.
  2. To insert an actionbetween two action rows:
    1. Click the selector for the action row just below the row where the new action is to be inserted.
    2. Click Insert Row.
  3. In the Action column, click the arrow icon.
  4. The action listis displayed.
  5. Select an action.

  1. You can specify arguments for the action in the lower part of the window. For argumentswhose settings are a database objectname, drag the object from the Database windowto Object Name argument box.

  1. Type a comment for the action. Comments are optional.

You can organize macros as a macro group, to avoid tracking each macro separately. To group several related macros,

  1. In the Database window,click Objects > Macros.
  2. On the Database window toolbar, click New.
  3. Click Macro Names
  4. Type a name for the first macro in the macro group.
  5. Add an action.

Note: When you run a macro group, MS Access executes each macro, starting from the first action, until it encounters a Stop Macro action, another macro group name, or no further actions. When you save the macro group, the name you specify is the name of the group of macros. This name is displayed in the list of macros and macro groups in the Database window.