Article ID: 324587 - Last Review: August 2, 2004 - Revision: 4.0 How to bring a subtotal from a Subform to a main form in Access 2002This article was previously published under Q324587 On This PageSUMMARY This article shows you how to reference a subtotal control
on a subform from a main form. More InformationIf you try to sum a subform field by using a calculated control on a main form, you may receive an error message in the main form control. For example, the following expression in a main form control generates a "#Name?" error message: =Sum([MySubForm].Form![ExtendedPrice])
There is an example of this method in the Orders form of the Northwind sample database (Northwind.mdb). First, a calculated control in the footer of the Orders Subform sums the Extended Price field of the subform to create a subtotal. The calculated control uses the following syntax: Text Box Control ---------------- Name: OrderSubtotal ControlSource: =Sum([ExtendedPrice]) Text Box Control ---------------- Name: Subtotal ControlSource: =[Orders Subform].[Form]![OrderSubtotal] REFERENCESFor more information about referencing subform controls,
click Microsoft Access Help on the Help menu, type calculating a total in a subform in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
| Article Translations
|
Back to the top
