Share this Page URL

Chapter 13. Completing Your Database App... > Creating Macro Groups and Using Macr... - Pg. 465

Completing Your Database Application 4. 5. 6. 7. 465 Click the Reports option group. On the Event tab of the Properties dialog box, set the After- Update event property to SwitchboardForms.EnableCountryList. Click the option group for report output (Preview or Print). Set its AfterUpdate event property to the macro SwitchboardForms.ChangeButtonCaption. Save the changes to the form, and then click the View button on the toolbar to display the form in Form view. Select Products By Country in the Reports option group. Selecting this option triggers the AfterUpdate event, and the EnableCountryList macro runs. As you can see here, after selecting this option, you can now make a selection in the Country list: On your own, you can select a country and print or preview this report or select a different report and change the selection in the output option group to see how the macros work to- gether with the form. Just the Steps Create a macro group 1. 2. 3. 4. 5. 6. In the Database window, click Macros in the Objects list, and then click New. On the View menu, click Macro Names. In the Macro Name column, enter a name for the first macro in the group. In the Action column, select the macro action, and then enter the argument settings required for the action in the Action Arguments area of the window. You can select more than one action for a macro. Enter the name of the next macro in the group in the Macro Name column, and then repeat step 4. Save and name the macro. Just the Steps Define macro conditions 1. 2. 3. In the Database window, click Macros in the Objects list, and then click New. (Or select the macro to which you want to add conditions, and then click Design.) On the View menu, click Conditions. Enter the macro condition in the Condition column. A condition might test whether a form is loaded or whether a field on a form is Null.