Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to print page totals in your reports

Status
Not open for further replies.

CosmoKramer

Programmer
May 29, 2001
1,730
US
This can be done with just a little bit of code........

Add an unbound text box to your detail section (for example, txtSum) and set it to be invisible.

In the On Format event of your page header section, put the following code:

Code:
txtSum = 0
This will reset the variable to 0 for each new page.

In the On Format event of your detail section, put the following code, of course changing txtFieldToBeSummed to your field to calculate:

Code:
txtSum = txtSum + txtFieldToBeSummed

Add a text box to your page footer to display the page total. Set its control source to =[txtSum] which holds the last running sum amount.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top