Sums

S

Swansie

I have 5 different subforms on a single form. Each subform produces a total
price for different types of products. Is there a way to sum all the prices
on the subforms on the single form?
 
A

aaron.kempf

can't you just do this in pivotTable view?

what version of Access are you working with?
 
J

John Vinson

I have 5 different subforms on a single form. Each subform produces a total
price for different types of products. Is there a way to sum all the prices
on the subforms on the single form?

Yes. You can put textboxes on each subform's Footer to get the
subtotal for that subform (I'm guessing that's what you have). Then
you can create a textbox on the mainform to sum them; set its Control
Source to

=NZ(subFirst.Form!txtTotal) + NZ(subSecond.Form!txtTotal) + ...

using the name property of the Subform Controls (which might not be
the same as the name of the form within that control) and the name of
the footer textbox. The NZ() ensures that you get a total even if
there is no data in the total for one or more subforms.

John W. Vinson[MVP]
 
S

Swansie

Thank you. Perfect

John Vinson said:
Yes. You can put textboxes on each subform's Footer to get the
subtotal for that subform (I'm guessing that's what you have). Then
you can create a textbox on the mainform to sum them; set its Control
Source to

=NZ(subFirst.Form!txtTotal) + NZ(subSecond.Form!txtTotal) + ...

using the name property of the Subform Controls (which might not be
the same as the name of the form within that control) and the name of
the footer textbox. The NZ() ensures that you get a total even if
there is no data in the total for one or more subforms.

John W. Vinson[MVP]
 
Top