View Full Version : report group sum and total sum


fanfan2
11-08-2009, 08:59 PM
On the report (file attached), I try to make a sum of the length field, i created a text box to sum the length but it shows as "Error". I also want to make sums of each group. How can I do it? and what was the problem? I'm new on this, thanks in advance.

boblarson
11-08-2009, 09:09 PM
Three things -

1. You need to change the text box name for the LENGTH field to txtLENGTH instead of LENGTH (do not use the same name for the control as the field in a report if you want to use it in a calculation).

2. Then use NZ to handle nulls.

3. Then you need a group footer, not the page footer.


See attached revised copy.

fanfan2
11-09-2009, 10:09 AM
Thank you so much.

I also want to add a total sum at the end of the group to sum all the group lengths. I created a text box on the group footer, then typed
=Sum(Nz([LENGTH],0)) on the control source, then changed the running sum to "over all". but the results only shows the last group sum. What did I do wrong? Thanks.

fanfan2
11-09-2009, 10:45 AM
Also I tried to create a text box that associates with a query. Not sure how I should do it. I created the text box on the report footer, but it turned out to be a parameter query...file is attached. Thanks again for your help.

boblarson
11-09-2009, 10:54 AM
How about this (see attachment)

fanfan2
11-09-2009, 12:01 PM
My Goodness - that was fast! Thanks soooooo much.

fanfan2
11-09-2009, 12:12 PM
Another question was: how do I connect my text box to a query as shown on the report? Thanks again.

boblarson
11-09-2009, 12:38 PM
Another question was: how do I connect my text box to a query as shown on the report? Thanks again.

Okay, check it out (had to modify your query slightly to give the field a name).

fanfan2
11-09-2009, 12:44 PM
Perfect. Thank you so much for your help. This is really an excellent forum with all the experts around.

boblarson
11-09-2009, 12:47 PM
Perfect. Thank you so much for your help.
Glad we could help. :)