Running and Testing a Macro

To have a macro perform its actions, you must run it, or instruct it to execute its actions. There are two ways to run a macro. You can have the macro perform all the steps in a sequence at once, or you can test a macro by running it to perform one step at a time, allowing you to review the results of each step. By testing your macro, you might discover that it did not perform all its tasks in the way you expected. If so, you can make changes and retest the macro as you continue to make adjustments in Macro Design view. Keep in mind that a macro will perform only the actions that are appropriate in the currently active view, so be sure to display the correct view before you run the macro; you can have the first action in the macro display the view in which you want to run the macro.

Run a Macro in a Sequence

graphics/1_icon.jpg Display the macro you want to run in Macro Design view.

If your macro does not automatically switch you to the correct view, switch to the view in which you want to run the macro.

graphics/2_icon.jpg Click the Run button on the Macro Design toolbar.

If the macro encounters an action it cannot perform, a message box appears, indicating a problem.

graphics/3_icon.jpg

If necessary, click OK to close the message box.

graphics/4_icon.jpg

Click Halt to stop the macro.

graphics/13inf12.jpg

Did You Know?

You can run a macro from the Database window . In the Database window, click the Macros tab, and then double-click the name of the macro you want to run.

You can place a macro on a toolbar . If you want to place a macro on the toolbar, click the Tools menu, click Customize, click the Commands tab, choose the All Macros category, drag the macro you want to the toolbar, and then click OK.


Test a Macro Step-by-Step

graphics/1_icon.jpg

Display the macro you want to run in Macro Design view.

graphics/2_icon.jpg Click the Single Step button on the Macro Design toolbar.

If necessary, switch to the view in which you want to run the macro.

graphics/3_icon.jpg Click the Run button on the toolbar.

If the Run button does not appear, click the Tools menu, click a macro, click Run Macro, click the Macro Name list arrow, and then double-click the macro you want to run, and then click OK.

graphics/4_icon.jpg

Click Step to perform the first action in the macro.

graphics/5_icon.jpg Repeat step 4 until the macro finishes.

If the macro encounters an action it cannot perform, you see a message box stating the action it could not carry out.

graphics/6_icon.jpg

Click OK to close the message box.

graphics/7_icon.jpg

Click Halt to stop the macro.

graphics/13inf13.jpg

Did You Know?

You can stop the macro before it finishes . In the Macro Single Step dialog box, click Halt.

You can run all steps in a macro . If the Single Step button on the Macro Design toolbar is active, you can still run all the steps in the macro without stopping. In the Macro Single Step dialog box, click Continue.




Show Me Microsoft Office Access 2003
Show Me Microsoft Office Access 2003
ISBN: 0789730049
EAN: 2147483647
Year: 2002
Pages: 318

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net