Sums

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
can't you just do this in pivotTable view?

what version of Access are you working with?
 
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]
 
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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top