Ready to Checkout?

shopping-cart

Try the Access Course for Free!

Standalone Macros in Access – Instructions

by / Wednesday, 10 May 2017 / Published in Access 2013, Access 2016, Latest, Office 2016, Office 365

Standalone Macros in Access: Overview

            Standalone macros in Access are programs you create in a visual environment. In Access, standalone macros run a series of actions in a specified order. Unlike embedded macros, standalone macros in Access appear as separate objects under the “Macros” category in the database’s Navigation Pane.

            Standalone macros in Access perform tasks required to use the database. For example, a standalone Access macro could check which value a user has selected in a form field. It could then open a corresponding report based on the value of the field.

            When writing macros, you need to know both the “Actions” and “Arguments” for each action. The “Actions” are the activities performed by each step in the macro. The “Arguments” are the additional settings that specify what each action does. To make macro creation easier, Access comes with a macro design window.

Overview: How to Create Standalone Macros in Access

            To create standalone macros in Access, click the “Create” tab in the Ribbon. Then click the “Macro” button in the “Macros & Code” button group. This opens the macro design window. It also displays the “Design” tab of the “Macro Tools” contextual tab in the Ribbon.

            Next, select the actions the macro performs when it is executed. Select the first action from the drop-down that appears in the macro design window. After selecting the action, you need to enter the action’s arguments. These are the additional settings required to make the selected action work. Enter the arguments into the fields shown within the action.

            The arguments vary considerably depending on the selected action. Some actions simply need more arguments than others do. Many have default arguments you can change, as needed. Some arguments have no default value, but require you to enter an expression, instead. Also, some arguments are required for an action to work. For example, if you select the “OpenForm” action, you must specify the name of the form to open.

            If you hold your mouse pointer over one of the action argument’s fields, Access shows help about it in a tooltip. You can click the “Tell me more” link in this tooltip to show the associated help file. This makes entering the actions and arguments easier by telling you what information is required. It also often shows you examples.

Standalone Macros in Access - Instructions: A picture of a user showing the help file for a macro action.

Standalone Macros in Access – Instructions: A picture of a user showing the help file for a macro action.

            To remove an action from a macro, click the delete button. This button looks like a small “x” in the upper-right corner of the selected action.

            To complete the macro, continue selecting actions from the “Add New Action” drop-down below your current action. Then set the arguments your actions require. After selecting all the macro’s actions and arguments, save the macro. To save standalone macros in Access, click the “Save” button in the Quick Access toolbar. Enter the standalone macro’s name in the “Macro Name” field in the “Save As” dialog box. Give it a name that describes its purpose within the database. Then click the “OK” button in the “Save As” dialog box.

Overview: Running Standalone Macros in Access

            There are many way to run standalone macros in Access. One way to run standalone macros in Access is to right-click any macro name in the Navigation Pane. Then click the “Run” command in the pop-up menu that appears. Another way to run standalone macros in Access is to double-click the macro name in the Navigation Pane. A third way to run standalone macros in Access is to open them in design view. Then click the “Design” tab of the “Macro Tools” contextual tab within the Ribbon. Then click the “Run” button in the “Tools” button group.

Overview: Editing Standalone Macros in Access

            To edit standalone macros in Access, right-click the name of the macro to edit in the Navigation Pane. Then select the “Design View” command in the pop-up menu that appears to display the macro’s design view. Here you can change the macro actions and arguments, as needed, and then save it again. After creating the macro and ensuring it works, you can then add it to a command button’s “On Click” event in a form. This lets the users of the form click the command button to execute the macro when using the database.

Standalone Macros in Access: Instructions

  1. To create standalone macros in Access, click the “Create” tab in the Ribbon.
  2. Then click the “Macro” button in the “Macros & Code” button group.
  3. This opens the macro design window.
  4. It also displays the “Design” tab of the “Macro Tools” contextual tab in the Ribbon.
  5. Select the first macro action from the drop-down that appears in the macro design window.
  6. Then enter the action’s arguments into the fields shown within the action.
  7. To view help about an action or argument in a tooltip, hold your mouse pointer over one of the fields shown in the action arguments.
  8. Then click the “Tell me more” link in the tooltip to show the action or argument help file, if available.
  9. To remove an action from a macro, click the delete button in the upper-right corner of the selected action.
  10. Continue selecting actions from the “Add New Action” drop-down below your current action and specifying the arguments your actions require until finished.
  11. To save standalone macros in Access, click the “Save” button in the Quick Access toolbar.
  12. Enter the macro’s name into the “Macro Name” field in the “Save As” dialog box.
  13. Then click the “OK” button in the “Save As” dialog box.
  14. To run standalone macros in Access, right-click any macro name in the Navigation Pane and then click the “Run” command in the pop-up menu that appears or double-click the macro name in the Navigation Pane.
  15. To edit standalone macros in Access, right-click the name of the macro to edit in the Navigation Pane.
  16. Then select the “Design View” command in the pop-up menu that appears.
  17. In the macro’s design view, change it as needed, and then save it again.

Standalone Macros in Access: Video Lesson

            The following video lesson, titled “Creating a Standalone Macro,” shows you how to use standalone macros in Access. This video lesson is from our complete Access tutorial, titled “Mastering Access Made Easy v.2016-2013.”

TOP