[ Team LiB ] Previous Section Next Section

Assigning a Macro to a Button

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

graphics/1_icon.jpg

In Design view for a form, click the Command Button tool on the Toolbox.

graphics/2_icon.jpg

Click the Control Wizards button on the Toolbox.

graphics/3_icon.jpg

Drag the image onto the form, report, or page.

graphics/4_icon.jpg

Click Miscellaneous.

graphics/5_icon.jpg

Click Run Macro and then click Next.

graphics/6_icon.jpg

Choose the macro you want to run, and then click Next.

graphics/13inf16.jpg

graphics/7_icon.jpg

Specify the text or image that will appear on the button, and then click Next.

graphics/8_icon.jpg

Enter a name for the command button control, and then click Finish.

graphics/9_icon.jpg

Save the form or report, and then test the button to verify that your macro runs when the button is clicked.

graphics/13inf17.jpg

    [ Team LiB ] Previous Section Next Section