VBA Counter adding 1 again on new page

geraldcor

Registered User.
Local time
Today, 14:56
Joined
Jan 26, 2004
Messages
145
Hello all,

I have a report where I am counting based on certain criteria in the form of
If such and such = this then
counter = counter + 1
Elseif....
End If

The counter works fine up until I hit a new page. The counter counts once, goes to the new page and then counts again. So for each page of the report, the counter is inflated by 1. I am doing it this way because I have 5 different things I am counting. The counter code is in the detail and the variables are integers declared in the Option Compare Database section (global). I have had nothing but grief with counters on Access reports.

Does anyone know why it is adding one and if so how to remedy this? Thanks

Greg
 
Look at the Retreat event in VBA help for an explanation of the problem.
 
Oh Good Grief! Ok. Thanks. I guess I will have to do yet another hack to get access to do what I want.

Thank you for the reply

Greg
 
AGH! I had this problem at one point, and I didn't know about the Retreat event.

I do now though, cool :)

I ended up getting around the issue in another way...but it was more complex than needed.
 
LOL, no problem.
 

Users who are viewing this thread

Back
Top Bottom