Page Number on a Report

L

Lamar

Is there a way to calculcate the number of pages on a report without
previewing or opening the report first?

Is there some back way using VBA? I just need the number of pages, I do not
want user to see or have to preview the report to get the number of pages?

Thanks for any help.
 
E

Eric Blitzer

This is directly from the visual basic help files for
access. I got it from a previous post.

Dim intTotalPages As Integer
Dim strMsg As String

intTotalPages = Me.Pages
strMsg = "This report contains " & intTotalPages & "
pages."
MsgBox strMsg
 
J

John Spencer

Perhaps.

It depends on whether or not you have can grow or can shrink set on the
various sections of the report and what headers and footers etc. you may
have.

I guess the question is WHY do you need to do this? The number of pages
is the number of pages in the report. What behavior are you going to
change if the report is 51 pages versus 56 pages?

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 

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