Database designers often attach macros to form controls, particularly buttons, so that when a user clicks the button, the macro is activated. If you create a button, you can use the Command Button Wizard to specify the action that will occur when the button is clicked. If you want to assign a macro to a button, you choose the action of running the macro.
Assign a Macro to a Button
|
In Design view for a form, click the Command Button tool on the Toolbox.
|
|
Click the Control Wizards button on the Toolbox.
|
|
Drag the image onto the form, report, or page.
|
|
Click Miscellaneous.
|
|
Click Run Macro and then click Next.
|
|
Choose the macro you want to run, and then click Next.
|
|
Specify the text or image that will appear on the button, and then click Next.
|
|
Enter a name for the command button control, and then click Finish.
|
|
Save the form or report, and then test the button to verify that your macro runs when the button is clicked.
|
|