Macros allow you to automate common tasks such as printing a report or opening a form. If you find yourself repeating common tasks over and over, you might want to consider creating a macro, especially if the task contains one or more steps.
If you have worked with Microsoft Word, PowerPoint or Excel, you may already be familiar with the concept of macros. In these applications, you create macros by recording your keystrokes, mouse clicks, and menu commands. Creating macros is a little different in Access as you do not record your macro actions but rather enter the actions and arguments directly in the Macro Designer window.
Access 2010 has enhanced the Macro Designer window to make it even easier to create macros. The Macro Designer work right inside of access and features an IntelliSense builder – as you choose your action, boxes appear below allowing you to set your conditions and parameters.
The Action drop-down list of the Macro Designer window contains a drop-down list of macro commands available to you. You can either choose an action from the Add New Action drop-down list or choose it from the Action catalog. Action in the Action Catalog are grouped by their function. To add an action from the Action Catalog to the macro window, either double-click the macro or click and drag it to the macro window form the Action Catalog.
Most macro actions contain Arguments. An Argument is a value that provides information to the action. For example, if you use the OpenForm macro action, the Argument would tell the action which form to open.
Now while the new macro designer might seem a bit overwhelming at first glance – especially if you are used to working with the old macro window – you’ll get the hang of it in no time at all once you dive in – and you will be surprised at how powerful the new Macro Designer is.
To Create a Macro
- Click the Create tab on the Ribbon.
- Click the Macro button on the Macros & Code group on the Ribbon.
- Click the drop-down arrow on the Add New Action drop-down list and choose the action from the list that you want the macro to carry out
Double-click the action you wish to use in the Action Catalog (click the plus or minus signs to expand or collapse the Actions groups)
Drag an action from the Action Catalog to the Macro window.
- In the lower part of the window, enter any arguments for the action, if required.
- To add more actions to the macro, move to the next blank Add New Action drop-down list and repeat steps 3-5 (Access executes the macro actions in the order that they are listed in the action column).
Applies to Access 2010