Microsoft Office Tutorials and References
In Depth Information
Creating Command Buttons
After creating a command button with the wizard, you can edit its
properties, as described in “Customizing your command button,” later in this
Making a button to display a related form
You can make a command button that displays another form. You can
display any old form in the database, but this kind of command button is most
powerful when you use it to display a form that shows the records of a table
that relate to the records in your original form. Suppose that you’re
working on an Order form that displays information about each order from your
online store. You can add a command button that opens the Address Book
form to show the record for the customer who placed the current order,
including the customer’s address, phone number, and other information.
Here’s how to add a button that displays another form:
1. With the form open in Design view, click the Button control icon in
the Controls group on the Design tab of the Ribbon.
2. Click the form where you want the button to appear.
The Command Button Wizard fires up to create your button (refer to
Figure 3-7, earlier in this chapter).
3. Select the Form Operations category and the Open Form action, and
then click Next.
Access displays a list of the forms in your database.
4. Choose the name of the form you want the button to open, and
The wizard asks whether to display the form with all records available or
to display a specific record. In this example, it would be nice to display
the Address Book record for the customer whose order you’re editing.
5. Choose the option titled Open the Form and Find Specific Data to
Display, and click Next.
You see two lists of fields, as shown in Figure 3-8. The left list shows the
fields in the record source of the current form. The right list shows the
fields in the record source of the form that you want the button to open.
6. Select the fields from the two forms that match (click a field in the left
list and a field in the right list); click the <-> button; and then click
If you’re adding a button to open the Address Book1 form with the
record of the customer who placed the order displayed on the Orders
form, the ContactID field on the Orders form should match the
ContactID field on the Address Book1 form.
7. Choose the text or picture to appear on the form, and click Next.