To add a macro to a form in Access 2013 or 2016:

  1. Create a macro
  2. Now, open the form in Design view
  3. Click the Button icon in the Ribbon (from the DESIGN tab)
  4. In the Form Detail area, click and drag the cursor so that it forms a square or rectangle (i.e. shape of a button). The Command Button Wizard will pop up. Select Miscellaneous > Run Macro and click Next
  5. Select the name of the macro you want to run and click Next
  6. Choose whether to display text or an image on the button and click Next
  7. Give the button a name and click Finish

Below are screenshots for the above steps.

Create a Macro

Here’s an example of a macro that runs a query. If you don’t know how to create macros, see how to create a macro in Access.

Screenshot of a macro in Access 2013

Example of a macro that runs a query.

Open the Form

Now, open the form in Design view.

Click the Button Icon

Click the Button icon in the Ribbon (from the DESIGN tab):

Screenshot of the button icon on the Ribbon in Access 2013.

The button icon on the Ribbon.

Add the Button to the Form

In the Form Detail area, click and drag the cursor so that it forms a square or rectangle (i.e. shape of a button). The Command Button Wizard will pop up. Select Miscellaneous > Run Macro and click Next:

Screenshot of Command Button Wizard in Access 2013.

The Command Button Wizard allows you to specify what action will take place when the button is clicked.

Select the Macro

Select the name of the macro you want to run and click Next.

Text or Image Button?

Choose whether to display text or an image on the button and click Next.

Name the Button

Give the button a name and click Finish.

Screenshot of form in Design view with macro button.

A form in Design view with a macro button.

The user can now run the macro by clicking on the button.