cmckeever said:
Well, I used "debug.print" and the variable in the module does wind up with
the right number (79).
"txtReportTotal" (see below) is the control source for the text box in the
report footer. It is declared as a Public variable in the General section of
the module. I also checked the references and they seem to be the same as
the 2002 references except using the Object 11.0 library instead of the
Object 10 library.
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
txtReportTotal = txtReportTotal + 1
Debug.Print txtReportTotal
End Sub
We just had someone else point this out a few days ago. THe
issue is that a Public variable in a class module (your
report's module) is a property of the class. In AXP, this
worked, but in A2003 it doesn't. I think that is good
enough to answer your question, but the real issue here is
that regardless of how long your code has worked, it was
never guaranteed that it would continue to work.
The real problem is that you can not use code in event
procedures to calculate any multi record value. The events
can be executed as many times and in whatever order Access
requires to present the report.
You should either use an aggregate function (Count, Sum,
etc) in a group and/or report header/footer section or use a
text box with its RunningSum property set appropriately.
Based on your posted code, I think the footer text box could
just use the expression:
=Count(*)