Try the Access Course for Free!

Standalone Macros in Access – Instructions

/ / Access 2013, Access 2016, Access 2019, Access for Office 365, Latest, Office 2013, Office 2016, Office 2019, Office 365

Standalone Macros in Access: Video

            This 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.2019 and 365.”

Overview of Standalone Macros in Access

            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 automate database tasks. 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.

Creating 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 “Macro Design” contextual tab in the Ribbon. Note that this same tab also appears as the “Design” tab of the “Macro Tools” contextual tab in older versions of Access.

            Next, select the actions the macro performs when it is run. Select the first action from the drop-down that appears in the macro design window. After selecting the action, then enter the action’s arguments. These action arguments are the additional settings the selected action needs to be evaluated or to function. Enter the arguments into the fields shown within the action.

            Depending on the type of macro you are creating, the arguments will vary considerably. Some actions simply need more arguments than others. 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, then 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.

A picture of a user creating a standalone macro in Access.

A picture of a user creating a standalone macro in Access.

            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 the current action. Then set the arguments those 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.

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. Alternatively, double-click the macro name in the Navigation Pane. Alternatively, to run an Access macro, open it in the macro design window and then click the “Run” button in the “Tools” button group on the “Macro Design” contextual tab in the Ribbon.

            More commonly, you run standalone macros in access by clicking buttons in forms. You can attach a macro to a form button by either using the “Command Button Wizard” or by manually assigning the macro to a button’s event.

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.

Instructions on How to Create Standalone Macros in Access

  1. To create standalone macros in Access, click the “Macro” button in the “Macros & Code” button group on the “Create” tab of the Ribbon.
  2. Doing this opens the macro design window and shows the “Design” tab of the “Macro Tools” contextual tab in the Ribbon.
  3. Next, select the actions the macro will perform when it is run.
  4. Select the first action from the drop-down that appears in the macro design window.
  5. After selecting the action, then enter the action’s arguments. These action arguments are the additional settings the selected action needs to be evaluated or to function. Enter the arguments into the fields shown within the action.
  6. If you hold your mouse pointer over one of the fields in the action arguments, Access shows help about the currently selected argument in a tooltip. You can click the “Tell me more” link in this tooltip to show the associated help file for the action or argument. This makes entering the actions and arguments easier by telling you what information is required and showing you examples.
  7. To remove an action from a macro in Access, click the delete button, which looks like a small “x,” in the upper-right corner of the selected action.
  8. To complete the macro in Access, continue selecting actions from the “Add New Action” drop-down below the current action and set the arguments those actions require.
  9. To save the macro in Access after selecting all the actions and arguments needed for the macro, click the “Save” button in the Quick Access toolbar.
  10. Then enter the name for the macro into the “Macro Name” field in the “Save As” dialog box.
  11. Then click the “OK” button in the “Save As” dialog box.

Instructions on How to Run Standalone Macros in Access

  1. To run a standalone macro in Access, right-click the name of any macro in the Navigation Pane and then click the “Run” command in the pop-up menu that appears.
  2. Alternatively, double-click the name of a macro in the Navigation Pane to run it.
  3. Alternatively, to run an Access macro, open it in the macro design window and then click the “Run” button in the “Tools” button group on the “Design” tab of the “Macro Tools” contextual tab in the Ribbon.

Instructions on How to Edit a Standalone Macro in Access

  1. To edit a standalone macro in Access, right-click the name of the macro to edit in the Navigation Pane.
  2. Then select the “Design View” command in the pop-up menu that appears to open the macro design view window.
  3. In this view, change the macro actions and arguments, as needed, and then save it again.
TOP