Access Macros  «Prev  Next»

Lesson 2What are Access macros?
ObjectiveLook at Access macros, and see where they are used in Access.

What are Access Macros?

Access macros are stored in what are called macro groups and these groups are stored in the objects listed in the Macros list of the Database window. Each macro group is broken down into individual macros. You can then edit these macros by using the Macro Builder, which will be discussed in the next lesson. You can see the macro list in the Database window as well as an example of a macro group in this figure:

An example of a macro group in Access
An example of a macro group in Access.

Two macro groups are displayed:
  1. The first macro, called TestMacro, displays a message box then opens a form.
  2. The second macro, called AnotherTest, simply displays a message box.

In a nutshell, Access macros are combined macro actions, each of which is selected from a list of macro commands. You can then set additional arguments for the current macro action. You can see the arguments for a macro action in the figure, where it says Action Arguments.
Once you have created a macro, you can perform the following:
  1. Run a macro from the macro list in the Database window.
  2. Assign the macro group and macro name to an event attached to various Access objects such as forms, reports, and controls. These events allow you to call macros (or code) when the user or computer causes an event to occur. Again, events will be discussed to a greater extent later in the module.
  3. Call the macro from another macro or VBA code.

You should note that Access macros are different from macros used in other Microsoft Office applications.
In the next lesson, you will learn how to use the Access Macro Builder to create and run an Access macro.