view last page of report

AnnPhil

Registered User.
Local time
Today, 05:46
Joined
Dec 18, 2001
Messages
246
is there anyway when opening a report to have it automatically open to the last page?
 
Hi Ann,

Dim I As Integer
DoCmd.OpenReport "Your_Report_Name", acViewPreview
I = Reports!Your_Report_Name.Pages
SendKeys "{F5}{Delete}"
SendKeys I & "{ENTER}"

Hope that helps!

-Sean
 
i tried your suggestion but got the following error message "The page number you enter is invalid"
Any idea what that means?

Thanks for you help
 
If your using Access 7, try building the report reference with the expression builder.

In later versions of Access, I use the expression builder in the criteria field of the QBE frame and then cut and paste it into my code. I haven't figured out how to otherwise use the expression builder in VBA in the later versions.

Maybe the foregoing will help. Maybe confuse.
 
it didn't work for me

I tried that code and got an error that said

"Invalid outside procedure" and it highlights the name of the report. Any sugguestions for corrections?
 
the code given by yippie_ky_yay doesn't work for me either. The Pages property doesn't seem to be updated. I=0 no matter how many pages are in the report. Any idea ?
 

Users who are viewing this thread

Back
Top Bottom