Microsoft Office Tutorials and References
In Depth Information
3. Scroll down the list, and then click 3073 . The current record changes from record 1
to record 41, which is the record for contract number 3073.
The form design is very plain at this point with no color, special effects, or visual con-
trast among the controls. Before making the form more attractive and useful, you’ll add
the remaining controls to the form: a subform and two calculated controls.
Adding a Subform to a Form
Lucia’s design for the form includes a subform that displays the related invoices for the
displayed contract. The form you’ve been creating is the main form for records from the
primary tblContract table (the “one” side of the one-to-many relationship), and the sub-
form will display records from the related tblInvoice table (the “many” side of the one-to-
many relationship). You use the Subform/Subreport tool in Design view to add a
subform to a form. You can add the subform on your own, or you can get help adding
the subform by using the SubForm Wizard.
You will use the SubForm Wizard to add the subform for the Invoice table records to
the bottom of the form. First, you’ll increase the height of the Detail section to make
room for the subform.
To add the subform to the form:
1. Switch to Design view.
2. Place the pointer on the bottom edge of the Detail section. When the pointer
changes to a shape, drag the section’s edge down until it is at the 4-inch mark
on the vertical ruler.
3. In the Controls group on the Design tab, make sure the Use Control Wizards tool
When you increase a sec-
tion’s height, you might
need to go slightly beyond
the desired ending position
to expose the vertical ruler
measurement, and then
decrease the height back
to the correct position.
4. In the Controls group on the Design tab, click the Subform/Subreport
5. Position the + portion of the pointer in the Detail section at the 2.5-inch mark on
the vertical ruler and at the 1-inch mark on the horizontal ruler, and then click the
mouse button. Access places a subform control in the form’s Detail section and
opens the first SubForm Wizard dialog box.
You can use a table or query, or an existing form as the record source for a subform.
In this case, you’ll use the related tblInvoice table as the record source for a new
To use the SubForm Wizard to add the subform to the form:
1. Make sure the Use existing Tables and Queries option button is selected, and then
click the Next button. Access opens the next SubForm Wizard dialog box, which
lets you select a table or query as the record source for the subform and the fields
from the selected table or query.
2. Click the Tables/Queries arrow to display the list of tables and queries in the Pan-
orama database, scroll to the top of the list box, and then click Table: tblInvoice .
The Available Fields list box shows the fields in the tblInvoice table.