Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / September 2005

Tip: Looking for answers? Try searching our database.

How do you force an open report to the last page with VBA?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Randall Arnold - 20 Sep 2005 23:16 GMT
I posted earlier today asking how to prevent code from executing until a form
was fully opened.  That's been solved.

However, the next step is programmatically forcing the report to the last
page.  I tried the following code:

Reports(strReport).Page = Reports(strReport).Pages

Interestingly enough, the Page value *is* changed to that of the last page,
but the report itself remains on page 1 as if no code was ever executed!

I searched through the DoCmd (and similar) actions, thinking I could use the
page tool at the bottom of the report to send either the page value or the
required number of clicks, but I can't find anything that looks promising.

Any ideas?

Thanks,

Randall Arnold
Randall Arnold - 21 Sep 2005 00:19 GMT
Never mind-- answered this one myself.  The following code does the trick:

   SendKeys "{End}"
   DoEvents

The DoEvents is important-- it makes sure SendKeys is processed; otherwise
code execution continues and the SendKeys doesn't fire until well past where
I want it.

Randall Arnold

> I posted earlier today asking how to prevent code from executing until a form
> was fully opened.  That's been solved.
[quoted text clipped - 16 lines]
>
> Randall Arnold
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.