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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page Totaling

Status
Not open for further replies.

DavidWill

Technical User
Jan 2, 2002
8
US
Hi,

I'm a new user to Access and need help with creating page totals in an Access report. The report will be used as an invoice and will need to have an item count and total amount per page of the invoice. Also the last page of the invoice needs to display the items and totals for all pages. The last page will need to look something like:

Page 1 has XX items totaling $xxxxx.xx
Page 2 has XX items totaling $xxxxx.xx
Page 3 has XX items totaling $xxxxx.xx
Page 4 has XX items totaling $xxxxx.xx
Grand total has XXXX items totaling $xxxxxxxx.xx

I could really use your help. Thanks in advance.
Dave
 
Dave

Interesting problem.... I don't think there's an easy way to do this - you'll need to write some code in the report module. I had a fiddle and the code below will do your page totalling and will work for simple reports. Your grand total you can do with a regular sum control.

Hope this helps.


=================================

Option Compare Database
Option Explicit

Dim iPageSum As Integer

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
iPageSum = iPageCount + Me.valueToSum
End Sub

Private Sub PageFooter_Print(Cancel As Integer, PrintCount As Integer)
Me.page_sum = iPageSum
End Sub

Private Sub PageHeader_Print(Cancel As Integer, PrintCount As Integer)
iPageSum = 0
End Sub Best Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top