Database Reference
In-Depth Information
Displaying subforms
As you saw in “Exploring forms” in Chapter 1, “Explore Microsoft Access 2013,” if a one-to-
many relationship exists between two tables, you can display information from both the
“one” and the “many” sides of the relationship by using a main form and a subform. For
example, the main form for related Customers and Orders tables might display information
about a customer (the “one” side), and the subform might list all the orders that the cus-
tomer has placed (the “many” side).
Suppose you want to create a main form that includes all the fields of one table with a sub-
form that includes all the fields of another table. As long as there is only one one-to-many
relationship between the tables already defined on the Relationships page, the fastest way
to create the form and its subform is by using the Form tool. Simply click the primary table
in the Navigation pane, and then on the Create tab, in the Forms group, click the Form but-
ton. The Form tool creates and displays a main form and subform, each containing all the
fields of its source table.
Selecting fields for main forms and subforms
If you want to create a main form and subform that include only some of the fields in
their underlying tables, use the Form wizard, as follows:
8
1
Ensure that there is a relationship between the tables. Then on the
Create
tab, in
the
Forms
group, click the
Form Wizard
button.
2
On the wizard's first page, in the
Tables/Queries
list, click the table on which you
want to base the form.
In the
Available Fields
list, double-click the fields you want to include in the main
form to move them to the
Selected Fields
list.
3
In the
Tables/Queries
list, click the table on which you want to base the subform.
4
In the
Available Fields
list, double-click the fields you want to include in the sub-
form, and then click
Next
.
5
On the wizard's second page, with the primary table and
Form with subform(s)
selected, click
Next
.
6
On the third page, select the layout you want, and then click
Next
.
7
On the last page, enter the titles you want for your forms, and with
Open the form
to view or enter information
selected, click
Finish
.
8