Microsoft Office Tutorials and References
In Depth Information
Displaying a Subform’s Calculated Controls in
the Main Form
For the invoices displayed in the subform, Lucia’s form design includes calculated con-
trols in the main form for the number of invoices and for the total of the invoice amounts
for the related records displayed in the subform. To display these calculated controls in a
form or report, you use the Count and Sum functions. The Count function determines the
number of occurrences of an expression, and its general format as a control in a form or
report is =Count( expression ). The Sum function calculates the total of an expression, and
its general format as a control in a form or report is =Sum( expression ). The invoices and
invoice amounts are displayed in the subform’s Detail section, so you’ll need to place
calculated controls for the number of invoices and the total invoice amounts in the sub-
form’s Form Footer section. However, your design has these two calculated controls dis-
played in the main form, not in the subform. Fortunately, the subform appears in
Datasheet view, and Form Headers and Footers do not appear in Datasheet view, so the
subform’s calculated controls will not appear in the subform. Although the calculated
controls are not displayed in the subform, the calculations occur, and you can add calcu-
lated controls in the main form that reference the subform’s calculated controls and dis-
play these values.
Adding Calculated Controls to a Subform’s Form Footer
Section
First, you’ll open the subform in Design view in another window and add the calculated
controls to the subform’s Form Footer section.
To add calculated controls to the subform’s Form Footer section:
1. Save your form design changes, switch to Design view, click the subform border
to select the subform, right-click the border, and then click Subform in New
Window on the shortcut menu. The subform opens in Design view. See
Figure 6-40.
Figure 6-40
Subform in Design view
drag the bottom edge
of the s ection bar down
to increase the Form
Footer section’s height
0.5-inch
mark on the
vertical ruler
 
Search JabSto ::




Custom Search