Microsoft Access 2010 Bible

(Rick Simeone) #1

Part IV: Professional Database Development


1076


Follow these steps to create an embedded macro that opens frmContacts:


  1. Click the Create tab on the ribbon, and then click the Form Design button in the Forms
    group.

  2. In the form’s Design ribbon, deselect the Use Control Wizards option in the Controls group.


For this example, you don’t want to use a wizard to decide what this button does.



  1. Click the Button control and draw a new button on the form.

  2. Set the button’s Name property to cmdContacts and the Caption property to
    Contacts.

  3. Display the Property Sheet for cmdContacts, select the Event tab, and then click the On
    Click event property.

  4. Click the builder button — the button with the ellipsis (...).


The Choose Builder dialog box (shown in Figure 30.19) appears.


FIGURE 30.19
Use the builder button in the event property to display the Choose Builder dialog box to
create an embedded macro.


  1. Choose Macro Builder and click OK to display the macro window (shown in Figure 30.20).

  2. Add the OpenForm action to the macro, and then set the Form Name argument to
    frmContacts.

  3. Close the embedded macro, and click OK when you’re prompted to save the changes and
    update the property.


The On Click event property of cmdContacts now displays [Embedded Macro].

Free download pdf