totals printing as 0

D

Dennis

Is there any way to prevent my totals from being
displayed as 0 when they appear at the top of a page?

The totals can appear anywhere else on the page and there
fine, but if there is a page break and the totals appear
at the top of the next page, they are displayed as 0. I
tried moving the code around to the different events but
then I start getting weird results.

I can not use the built in sum function, because some
amounts are added several times because of multiple
records in the detail section.


Here is the code that I entered in the group footer:

****************************************************
Private Sub GroupFooter3_Print(Cancel As Integer,
PrintCount As Integer)
[Sum Of Total_Amount_Awarded] = SourceTotalAwarded
YearTotalAwarded = YearTotalAwarded +
SourceTotalAwarded
[Sum Of Total_Amount_Requested] = SourceTotalRequested
YearTotalRequested = YearTotalRequested +
SourceTotalRequested
SourceTotalAwarded = 0
SourceTotalRequested = 0
End Sub
****************************************************
Note: I have to reset the SourceTotals back to 0 at this
time.
 
M

Marshall Barton

Dennis said:
Is there any way to prevent my totals from being
displayed as 0 when they appear at the top of a page?

The totals can appear anywhere else on the page and there
fine, but if there is a page break and the totals appear
at the top of the next page, they are displayed as 0. I
tried moving the code around to the different events but
then I start getting weird results.

I can not use the built in sum function, because some
amounts are added several times because of multiple
records in the detail section.


Here is the code that I entered in the group footer:

****************************************************
Private Sub GroupFooter3_Print(Cancel As Integer,
PrintCount As Integer)
[Sum Of Total_Amount_Awarded] = SourceTotalAwarded
YearTotalAwarded = YearTotalAwarded +
SourceTotalAwarded
[Sum Of Total_Amount_Requested] = SourceTotalRequested
YearTotalRequested = YearTotalRequested +
SourceTotalRequested
SourceTotalAwarded = 0
SourceTotalRequested = 0
End Sub
****************************************************
Note: I have to reset the SourceTotals back to 0 at this
time.


It looks like you are calculating the totals in the details
section's Print event. If so, it's time to go back to the
drawing board, this approach just won't work (actually I'm
surprised you got this close).

If you'll post back with more information, maybe someone can
come up with another way to get what you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top