Microsoft Office Tutorials and References
In Depth Information
Using a Subform to Display Detail Records
To add a subform to a form, follow these steps:
1. Display the main form in Design view.
2. If the form doesn’t have enough room for the subform, make some
space by dragging the bottom edge of the form down.
You don’t know yet exactly how much space your subform will occupy,
of course, but make a space a few inches high.
3. Click the Subform/Subreport button in the Controls group on the
Design tab of the Ribbon.
4. Click the form where you want the top-left corner of the subform to
Access creates a subform control and runs the SubForm Wizard to lead
you through the process of configuring the control. (If the wizard isn’t
installed on your system, Access offers to install it.)
5. Do one of the following and then click Next:
choose the Use an Existing Form option, select the form in the list,
and skip to Step 8.
proceed to Step 6.
The wizard asks which fields you want to include in the subform and
what table or query the fields come from (that is, the record source
of the subform), as shown in Figure 4-5.
6. From the Tables/Queries drop-down menu, choose the table or query
that you want to use as the record source of the subform.
The table or query that you choose must contain a unique field that can
act as the primary field in a one-to-many relationship with the records
on the main form. If you’re adding a subform with order details (that
is, the specific items that were purchased) to an order form, the Order
Details and Orders tables may be related by an OrderID field.
7. Choose the fields you want to display on the subform by selecting
fields and clicking the > button; then click Next.
Alternatively, you can double-click a field name to move it from one list
to the other. If you want to display all the fields, click the >> button. As
you select fields, they move from the Available Fields list to the Selected
Fields list. Don’t choose too many fields; you have to fit them all into the