To add a macro to a form in Access 2013 or 2016:
- Create a macro
- Now, open the form in Design view
- Click the Button icon in the Ribbon (from the DESIGN tab)
- 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
- Select the name of the macro you want to run and click Next
- Choose whether to display text or an image on the button and click Next
- Give the button a name and click Finish