Discussion Locked

Access 2000-Report total problems

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am currently using a report that has totals of the fields on each page. I am having difficulty totaling those fields over the whole report on the last page of the report. (summary)

2 replies

by shanghai sam

I have found computing totals in Access reports to always pose problems. Frequently, doing the calculations "manually" behind the scenes (i.e., in VBA code) seems to be the easiest and best solution.

Let's call the controls for your total on each page footer total1 and the grand total grandtotal.

For the page footer on print property, insert the following:

me.grandtotal=me.grandtotal+me.total1

(Alternately, you could define a variable and use the variable instead of me.grandtotal until you get to the report total footer, then set me.grandtotal = variable.)

You should also do the following for the report header (even if it is a blank header):
me.grandtotal = 0

You might use the following statement instead of the one above to insure that you don't get tripped up by any nulls in the total1 control:

me.grandtotal=nz(me.grandtotal)+nz(me.total1)

The nz() function treats the control as a zero value if it is blank.

This will make sure that there is a value in thegrandtotal control.

by fernstar

It is important to place the totals in the correct grouping of the report.
If you create a group called Customer and set it up so there is a group footer, placing a summary field like 'Sum([Sales])' in the Customer footer will give you a total of sales at customer level.
Placing the same field 'Sum([Sales])' in the report footer will provide you with a total for the entire report.
Totals in Access reports work well, it is a matter of knowing where to place them.

This discussion is closed to new replies.