Total of totals on report.

todAnthony

Wait... What?
Local time
Today, 08:49
Joined
May 25, 2011
Messages
26
Looking to see how possible this is. With research I have not found anything yet.

In the report footer you get a field with a sum. I realize you can add =Sum([xField])+Sum([yField)] for a total and this could be done for multiple fields. Thats is if everything were simple.

Let's say you have 10 fields with a bit longer control source. For example:
=DSum("totalOccupied","qryWhiteOwnAbove","[ProjectName]=" & [ProjectName] & " And [TargetArea]=" & [TargetArea] & " And above=False")

Is it possible to get the sum of the 10 text boxes pulled from the report itself rather than adding the 10 long control sources pulled from other queries? I am talking about taking the 'answers' from the report rather than the query to generate another grand total.
 
I think I might be misunderstanding. If the field returns the proper data type, you can refer to it and sum it without using it's control source at all, like you indicated. DSum returns an integer, so you should be able to use a field based on that as [fieldX] if you want to.

However, DSum will return a null if nothing satisfies the criteria, not a zero value. That could be the issue you're having if you're just creating a sum on these fields.
 
Actually the blank return is one problem but first I was really just wanting to get a total on the 10 fields with out using such a huge expression.

=DSum("totalOccupied","qryWhiteOwnAbove","[ProjectName]=" & [ProjectName] & " And [TargetArea]=" & [TargetArea] & " And above=False")
is one control source and the other 9 are similar. I can add these up but I was first wondering if so much expreesion was a good idea or if there was a more efficent way of accomplishing this goal.
 

Users who are viewing this thread

Back
Top Bottom