Question : Access 97 - Totaling up numbers in a group footer

I am trying to SUM up some numbers in a report's group footer.  It's based on a text box in the Detail area whose name is "TotalforCompany," which is another text box I created which sums up a net amount (which is a calculation coming from the underlying query) plus tax (another text box with a calculation).  So in my text box calculation in the group footer's control source, I'm using =SUM([TotalforCompany]), and every time I run my report, it's giving me a prompt error message because it evidently doesn't know what I mean by this name.  I don't know what I'm doing wrong.  Help!!

Answer : Access 97 - Totaling up numbers in a group footer

The sum function in an access report can only sum the underlying data, not the controls (e.g. text boxes) that appear in the detail section.  If you want to sum a calulated control, you usually do it one of two ways.  By far the more reliable is to perform the calculation in the query that supplies data to the report.  Just add a field to the query and enter the formula for the calculation.  Give it a unique name and then in the report you can just place that field as you would any other field on your report.  The other is to repeat the formula in the control for the total field in the footer.  This works with most formulas, but can occasionally produce some unpredicatable results.

What makes this confusing is that when you build a report using a wizard, access automatically (and stupidly) assigns the name of underlying data field as the name of the control in the report.  Them when you use it in a footer, you THINK you're summing a control, but you're actually summing the underlying data field.  You just can't really tell which is which.
Random Solutions  
 
programming4us programming4us