Standalone vs. Embedded Macros
In previous versions of Access, all macros were individual database objects that could be used in event properties. Now with Access 2007, you can embed the macro directly in the event property without adding the macro to the object list in the Navigation Pane. If you do not expect more than one form or report control to need the macro, simply create it from the Property Sheet. If other form or report controls may be able to use the macro, save it as a standalone macro.
Standalone macros are individual Access objects listed in the Macros group in the Navigation Pane. Once you create and save a macro, it's available for attaching to an event property of any object in your database. Not all macro actions are appropriate for all objects, however, just as not all events occur on all objects. For example, if you create a macro that opens a form, you would probably attach it to the On Click event property of a command button or an option group, but not to a control in a report.
The process of using macros to automate an application is a simple one, composed of these steps:
- Open the form or report to which the macro applies in Design or Layout view and select the specific control.
- Open the Property Sheet for the control and click the Event tab.
- Click the desired event property and do one of the following:
- Choose the macro name from the drop-down list.
- Click the Build (...) button and use the Macro Builder to create the embedded macro.
- Save the form or report and switch to Form or Report view to try it.
In this tutorial:
- Automating with Macros
- Standalone vs. Embedded Macros
- Creating a Macro
- Choosing Actions
- Testing and Debugging a Macro
- Adding Conditions to a Macro
- Assigning a Macro to an Event Property
- Some Common Uses for Macros
- Filtering Records
- Changing the Flow of Operations
- Create a Macro Group
- Documenting Macros
- Creating an AutoExec Macro