>I have a report that looks back at the previous 20 years of data and prints
>the values and the % change from the previous year. All the data, including
[quoted text clipped - 20 lines]
>counter = counter + 1
>End Sub
You can not use an event procedure to calculate a value
across multiplt records. Remove the counter and figure out
another way to determine when to display the value.
I don't see the need for the extra text box, can't you just
make the TOTCHG text box visible/invisible? I would expect
the values for the first year to be different form the other
years. Isn't the value in TOTCHG Null for thefirst year?
If so, you shouldn't have to do anything.
If it's the negative of the year value, then you could use
code like:
Me.TOTCHG.Visible = (Me.TOTCHG <> -Me.yearvalue)

Signature
Marsh
MVP [MS Access]
AaronWestcott - 18 Jan 2007 18:16 GMT
Thanks for the reply.
The table of values has more than 20 years and the percent change from the
previous year associated with it. The report simply prints out he last 20
years using a query to grab the most recent 20 years. So I used the code to
essentially make the first appearance of the percent change field blank.
This actually works when I preview the report. It fails when I try to
actually print the report.
Furthermore, I just got done trying to right click from the database window
on the report and selecting the print option. That works. the print out does
not have the first instance of the percent change field. However, when I
preview the report, the first instance of the percent change field is blank,
when I print from the preview mode the print out is populated with its value
from the query. I don't know if this is a bug in access or not but it sure
is strange.
I will try make the field not visible on the first instance and see if that
works.
Thanks,
Aaron
Marshall Barton - 18 Jan 2007 20:03 GMT
>Thanks for the reply.
>
[quoted text clipped - 15 lines]
>I will try make the field not visible on the first instance and see if that
>works.
That counter stuff might appear to work in some
circumstances, but it is frought with trouble. Even in
preview it can produce odd results if you jump around the
pages. Please take my word on this, it comes from some
painful experiences that seemed to work - until users
applied their innovative way of viewing reports.

Signature
Marsh
MVP [MS Access]
AaronWestcott - 19 Jan 2007 13:51 GMT
I understand. I took your advice and tried changing the visible property and
that worked. It is also cleaner. Thanks for you help.
>>Thanks for the reply.
>>
[quoted text clipped - 8 lines]
>painful experiences that seemed to work - until users
>applied their innovative way of viewing reports.