Use of KB article 296249

G

Guest

Hello all,

By suggestion from Marsh, I used KB article # 296249
(http://support.microsoft.com/default.aspx?scid=kb;en-us;296249) to print out
summary data at the foot of every page on a report. This worked out perfectly
on a two-page report, but when the report is only one page long, instead of
the sum, I get a zero.

Can anyone (I guess Marsh!) help me figure out why this is happening? The
coding suggested in the article has the report turn the value of X to zero at
the report's head, could that have something to do with it?

Thanks very much!
Natalia
 
M

Marshall Barton

Natalia said:
By suggestion from Marsh, I used KB article # 296249
(http://support.microsoft.com/default.aspx?scid=kb;en-us;296249) to print out
summary data at the foot of every page on a report. This worked out perfectly
on a two-page report, but when the report is only one page long, instead of
the sum, I get a zero.

Can anyone (I guess Marsh!) help me figure out why this is happening? The
coding suggested in the article has the report turn the value of X to zero at
the report's head, could that have something to do with it?


You definitely need the x=0 statement in the REPORT header's
Print event.

The only(?) way I can think of to get a 0 in the page footer
is if the Print event runs twice? Let's try to debug this
by placing a Message box at the top of the code in the
PageFooter's Print event procedure:

MsgBox "Page'" & Me.Page & " x=" & x & " RunSum=" &
Me!RunSum

Then open the report to see what you get. If you see two
messages for Page 1, then try changing the code to:

If PrintCount = 1 Then
Me!PageSum = Me!RunSum - x
x = Me!RunSum
End If

If that doesn't cure the problem. we'll have to come up with
a different approach.
 
M

Marshall Barton

Natalia said:
By suggestion from Marsh, I used KB article # 296249
(http://support.microsoft.com/default.aspx?scid=kb;en-us;296249) to print out
summary data at the foot of every page on a report. This worked out perfectly
on a two-page report, but when the report is only one page long, instead of
the sum, I get a zero.

Can anyone (I guess Marsh!) help me figure out why this is happening? The
coding suggested in the article has the report turn the value of X to zero at
the report's head, could that have something to do with it?


Natalia, if you're still having an issue with this, please
look at the thread

Subject: Page sums for multiple values
Date: 12 Jan 2005
From: (e-mail address removed)

It discusses the same problem you were having and has an
alternate approach that appears to avoid the wierdness you
described.
 

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