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

Subtotals problem

Status
Not open for further replies.

accessNEWB

Technical User
May 20, 2002
10
CA
I have a very odd subtotals problem. When I first open a report and try to print it, the subtotals on the first page come out as 0. The second time I print the subtotals on the first page take on the values of the subs on the 2nd page. All subsequent pages are OK. Here's the code I used:

Dim x, y, z <= globals

Private Sub PageFooter_Print(Cancel As Integer, PrintCount As Integer)
[txtFeesSubtotal] = [txtFeesRunningSum] - x
x = [txtFeesRunningSum]

[txtDisbursementsSubtotal] =
[txtDisbursementsRunningSum] - y
y = [txtDisbursementsRunningSum]

[txtTotalSubTotal] = [txtTotalRunningSum] - z
z = [txtTotalRunningSum]
End Sub

Private Sub ReportHeader_Print(Cancel As Integer, PrintCount As Integer)
x = 0
y = 0
z = 0
End Sub

the runningsum fields are placed in the details section and are runningsums. subtotal fields are placed in the page footer and are supposed to work. They appear fine when I preview the report, but when I go to print it's a different story.

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top