[ Team LiB ] Previous Section Next Section

Modifying an Existing Macro

You have learned how to create a macro, add macro actions and their associated arguments, create macro subroutines by adding macro names, and conditionally execute the actions in the macro by adding macro conditions. However, after you have created a macro, you might want to modify it. To do so, you must first enter Design view for the macro and then follow these steps:

  1. Click the Macros tab of the Database window.

  2. Select the macro you want to modify.

  3. Click Design.

When the design of the macro appears, you can insert new lines, delete existing lines, move the macro actions around, or copy macro actions to the macro you're modifying or to another macro.

Inserting New Macro Actions

To insert a macro action, follow these steps:

  1. Click the line above where you want to insert the macro action.

  2. Press Insert, click the Insert Rows button on the toolbar, or choose Insert | Rows. Access inserts a new line in the macro at the cursor.

To insert multiple macro actions, follow these steps:

  1. Place the cursor on the line above where you want Access to insert the new macro action lines. Click the Macro Action Selector, which is the gray box to the left of the macro's Action column.

  2. Click and drag to select the same number of Macro Action Selectors as the number of macro actions you want to insert.

  3. Press the Insert key, click the Insert Rows button on the toolbar, or choose Insert | Rows. Access inserts all the new macro lines above the macro actions that you selected.

Deleting Macro Actions

Follow these steps to delete a macro action:

  1. Click the Macro Action Selector of the macro action you want to delete.

  2. Press the Delete key, click Delete Rows on the toolbar, or choose Edit | Delete Rows.

Follow these steps to delete multiple macro actions (macros):

  1. Click and drag to select the Macro Action Selectors of all the macro actions you want to delete. All the macro actions should be highlighted in black. (See Figure 13.15.)

    Figure 13.15. Selecting and deleting macro actions.

    graphics/13fig15.jpg

  2. Press the Delete key, click Delete Rows, or choose Edit | Delete Rows.

Moving Macro Actions

You can move macro actions in a few ways, including by dragging and dropping and by cutting and pasting.

To move macro actions by dragging and dropping, follow these steps:

  1. Click and drag to select the macro action(s) you want to move.

  2. Release the mouse button.

  3. Place the mouse cursor over the Macro Action Selector of any of the selected macro actions.

  4. Click and drag. A black line appears, indicating where Access will move the selected macro actions.

  5. Release the mouse button. Access inserts the macro actions where you release the mouse button.

graphics/bulb_icon.gif

If you accidentally drag and drop the selected macro actions to an incorrect place, you can use the Undo button on the Macro Design toolbar or choose Edit | Undo to reverse the action.


To move macro actions by cutting and pasting, follow these steps:

  1. Click and drag to select the Macro Action Selectors of the macro actions you want to move.

  2. Click Cut on the Macro Design toolbar (or use Ctrl+X).

  3. Click the line above where you want Access to insert the cut macro actions. Don't click the Macro Action Selector.

  4. Click Paste. Access inserts the macro actions at the cursor.

graphics/clock_icon.gif

Don't click the Macro Action Selector of the row where you want to insert the cut macro actions, unless you want to overwrite the macro action you have selected. If you don't click to select the Macro Action Selectors, Access inserts the cut lines into the macro, without overwriting any other macro actions; if you click to select Macro Action Selectors, Access overwrites existing macro actions.


Copying Macro Actions

You can copy macro actions within a macro or to another macro.

Follow these steps to copy macro actions within a macro:

  1. Click and drag to select the Macro Action Selectors of the macro actions you want to copy.

  2. Click Copy on the Macro Design toolbar (or use Ctrl+C).

  3. Click the line above where you want to insert the copied macro actions. Don't click any Macro Action Selectors unless you want to overwrite existing macro actions. (See the Caution preceding this section.)

  4. Click Paste. Access inserts the macro actions you copied at the cursor.

Follow these steps to copy macro actions to another macro:

  1. Click and drag to select the Macro Action Selectors of the macro actions you want to copy.

  2. Click Copy on the Macro Design toolbar (or use Ctrl+C).

  3. Open the macro that will include the copied actions.

  4. Click the line above where you want to insert the copied macro actions.

  5. Click Paste. Access inserts the macro actions you copied at the cursor.

    [ Team LiB ] Previous Section Next Section