Open reports have a Pages property, but it's a strange beast.
Trying to read:
Reports("Report1").Pages
from another routine will not be productive.
You could use the Print event of the Report_Footer section to write the
value of Pages to a public numeric variable, and then read the value in your
code, but there are several pitfalls with that approach, e.g.:
- It may not have run to the end yet.
- If there are events that mess with the runtime properties MoveLayout,
MoveRecord etc, the Pages property may contain the wrong value. In fact you
can end up with Page being 9 and Pages being 8.
- It is possible to programmatically reset the Pages property, so it may not
be correct.