Look 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:
Two macro groups are displayed:
The first macro, called TestMacro, displays a message box then opens a form.
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:
Run a macro from the macro list in the Database window.
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.
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..
Macros are organized into Macro Groups
In Microsoft Access, macros are organized into macro groups, and these groups are stored as objects that you can see listed in the "Macros" section of the Navigation Pane (formerly known as the Database window in older versions of Access). Here's how this system works:
Macro Groups: A macro group is essentially a container for multiple macros. Instead of having many standalone macros cluttering your database, you can group related macros together. This organization helps in managing your macros more efficiently, especially in larger databases with numerous automated tasks.
Storage in Objects:
When you create a macro in Access, you can choose to save it either as a standalone macro or within a macro group. If you opt for a macro group:
You name the macro group, and this name appears in the Macros list in the Navigation Pane.
Within this group, each macro has its own name, which you use to refer to it when calling the macro from other parts of your database, like forms or reports.
Accessing Macro Groups:
In the Navigation Pane, under the "Macros" category, you'll see each macro group listed.
To run a macro from a group, you would typically:
Use the RunMacro action in another macro or in VBA code, specifying both the macro group name and the individual macro name.
Or, directly from the Access interface, by right-clicking on the macro group in the Navigation Pane, selecting "Open", and then choosing the macro you want to run from within that group.
Advantages:
Organization: Grouping helps keep related macros together, making it easier to find and manage them.
Security and Access: You can set permissions on macro groups, controlling who can view, edit, or execute the macros within them.
Performance: It can improve database performance by reducing the number of separate objects Access needs to manage.
Usage:
When automating tasks like data entry, report generation, or updating records, you can define a series of macros within a group to handle different aspects of the task, making your database operations more modular and easier to maintain.
Understanding how to effectively use macro groups can significantly enhance your productivity with Microsoft Access, allowing for more complex automation and better database organization.
In the next lesson, you will learn how to use the Access Macro Builder to create and run an Access macro