Grand Total of a Running Sum

Trodelphin

Registered User.
Local time
Today, 13:15
Joined
Nov 13, 2010
Messages
42
have an invoice report set out like so

Heading
Description............Price....Quantity...a text box with "=[Price]*[Quantity]



however getting a grand total seems a problem
my totals tool only allows me to get a count records since sum is greyed out

any ideas ?
 
In the report footer, place a text box with this control source:

=Sum([Price]*[Quantity])

make sure you don't have any controls named Price or Quantity on the report (if you do, change those to txtPrice and txtQuantity) and you refer to the field names, but you have to recreate the formula in the footer or else it won't work right - you can't refer to a control in this instance.
 
given Price and Quantity are Control Sources for those fields i am assuming you are saying to relabel thier name under "other" property on the report ?
 
given Price and Quantity are Control Sources for those fields i am assuming you are saying to relabel thier name under "other" property on the report ?
Yes, that would be the case. But if you have Name AutoCorrect turned on, when you change those and save it, it will change your formula to use that (and you don't want that, you want the names of the fields). Make sure Name AutoCorrupt (AutoCorrect) is turned off on all of your databases.
 
ok i see what you mean but what if i want to then add the results of that box to another ?
say i have 2 running Sums that i want totaled
 
ok i see what you mean but what if i want to then add the results of that box to another ?
say i have 2 running Sums that i want totaled

A control source of say this:

Code:
= Sum(Nz([Price],0)*Nz([Quantity],0)) + Sum(Nz([SomeOtherField],0)
 
would i be correct in assuming that
=Sum([Price]*[Quantity])
would capture teh results of
a varing amount of =[Price]*[Quantity] in a column ?

cheers for help too btw :)
 
Yes, that is the case. Now I also put in the NZ function for everything to handle nulls so you don't end up with a problem because adding a null to a number will result in a null.
 
hmm still seem to be just generating an error
spot anything ?
 

Attachments

  • invoiceproblem.jpg
    invoiceproblem.jpg
    97.8 KB · Views: 167
If that isn't working peform a Price * Quantity in the record source (not the report), then perform a Sum() on that field.

Edit: yes Bob mentioned the footer.
 
yeah i had it in the Page Footer but it has to be in the Report footer
 
Page Footer or Report Footer, it doesn't matter as long as it's in a Footer.
 
Hmm i get an error as soon as i move it to the Page footer but works fine in the report footer
 
Create an alias field in your query, perform the Price * Total Hours in there, then Sum that field. That is:

Total: [Price] * [Total Machine Hours]

in the query. The query will become the record source of your report, if you've not already done so.
 
interesting error in my Subreport now :/
seems to be Quadrupaling any result
 

Attachments

  • invoice error.jpg
    invoice error.jpg
    58.8 KB · Views: 122
Are you summing inside the subreport or on the main report?
 

Users who are viewing this thread

Back
Top Bottom