subform calculation

E

Evan McCutchen

Hello, I have a subform (set to be viewed as continuous forms) that i would
like to take the total of a field on each of the forms that is shown and
display it on a textbox on the mainform. Does anyone have an idea on how i
should go about doing this?

Thanks for your comments!
Evan M
evan AT radiologyonesource DOT com
 
A

Allen Browne

In the Report Footer section of your subform, place a text box with these
properties:
Control Source: =Sum([Amount])
Format: Currency
Name: txtTotalAmount
That assumes the field to be summed is called "Amount", and it is a currency
field. (Use a format of General Number if you prefer.)

On the main form, enter a text box with ControlSource of:
=[NameOfYourSubformControlHere].[Form].[txtTotalAmount]

If that does not work for you, double-check the Name property of your
subform control. It may have a different name than the name of the form that
gets loaded into the control (its SourceObject).
 
E

Evan McCutchen

Allen, that works excellently! Thanks! Evan M.

Allen Browne said:
In the Report Footer section of your subform, place a text box with these
properties:
Control Source: =Sum([Amount])
Format: Currency
Name: txtTotalAmount
That assumes the field to be summed is called "Amount", and it is a currency
field. (Use a format of General Number if you prefer.)

On the main form, enter a text box with ControlSource of:
=[NameOfYourSubformControlHere].[Form].[txtTotalAmount]

If that does not work for you, double-check the Name property of your
subform control. It may have a different name than the name of the form that
gets loaded into the control (its SourceObject).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Evan McCutchen said:
Hello, I have a subform (set to be viewed as continuous forms) that i would
like to take the total of a field on each of the forms that is shown and
display it on a textbox on the mainform. Does anyone have an idea on how i
should go about doing this?

Thanks for your comments!
Evan M
evan AT radiologyonesource DOT com
 

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

Top