Access 2016 Advanced

Lesson 11 – Using Macros

Access 2016

Steps

Practice Data

6. Select the property list.

Click On Click

A list of events for the property appears .

7. Select the desired macro.

Scroll as necessary and click Phone list

The selected macro appears in the property box.

8. Select the Format tab.

Click the Format tab

The Format page appears.

9. Select the text in the Caption property.

Double-click to select the text in the Caption property, if necessary

The text in the Caption property is selected.

10. Type the text you want to appear on the button. The text appears in the Caption property. 11. Press [F4] to close the property sheet. The property sheet closes.

Type Display Phone List

Press [F4]

Close and save the Customers form. Open the Customers form in Form view and click the Display Phone List button. Notice that a query window with the customer numbers, contact names, and telephone numbers opens. Close the query and form windows.

A DDING A C ONDITION TO A M ACRO

Discussion

You can add a condition argument to a macro. An argument acts very much like a filter. Just as a filter displays only the records that meet the condition, the argument only performs the macro when the condition is met.

To execute macro actions only when certain conditions are true, use an If block. When an If block is executed, Access evaluates the condition if true, then carries out the action associated with the condition. If the condition is false, Access ignores the action and any immediately following actions for that condition.

Page 128

OFFICEPRO, Inc.

Made with FlippingBook - Online magazine maker