Microsoft Office Tutorials and References
In Depth Information
Adding Subtotals and Totals from Subforms
8. If you plan to display the subform in Form view, not just in Datasheet
view, hide the Form Footer section by setting its Visible property
Otherwise, you display the subtotal once on the subform and once on
the main form, which looks odd. Most subforms appear in Datasheet
view, which doesn’t display form headers and footers. If you do need
to hide the footer, click the Form Footer divider bar, find the Visible
property on the Format tab of the property sheet, and set the Visible
property to No.
9. Save and close the subform.
Press Ctrl+S to save your changes. Then go ahead and close the Design
View window; you’re done with it.
10. Open the main form in Design view, and display its property sheet by
clicking the Property Sheet button in the Tools group on the Design
tab of the Ribbon.
11. Create a text box to control the total by clicking the Text Box button
in the Controls group on the Design tab of the Ribbon and then
clicking the form where you want the calculated control to appear.
You get a new unbound control that’s ready to display your calculated
12. Set the text box’s Control Source property to an expression that
refers to the calculated control on the subform.
Here’s the expression that refers to the calculated control shown in
Figure 4-8, earlier in this chapter:
= [Order Details subform].Form![Order Subtotal]
Order Details subform is the name of the subform control.