Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Report to last page, maximized, and zoom to fit

Status
Not open for further replies.

bsedabres

MIS
Mar 5, 2003
6
US
All:

I am new to the Access programming world, so I apologize if this seems to be rudimentary. I have been trying at this for hours now, and I am running out of hair to pull out. My co-workers would like the following changes implemented to their tracking database:

1) a report that opens to the last page first?
2) auto-maximizing the display of a report when opened is not a problem, but can this be turned off or restored to original when the report is closed?
3) auto-zooming a report "to fit" when opened to eliminate any scroll bars?

Thanks for any help you can provide!
bas
 
bas this routine will move to the last page in a report.

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

I use it behind a button on a form to open the report and move to the last page of the report. You will need to substitute your Report name for mine.
2. To restore the size of your database, use the
DoCmd.Restore
method.
3. Not sure how to autofit the report to eliminate the scroll bars. I'll see if I can't find something on that.

Paul

 
Thanks Paul, this routine works great!
When I use it with a report based on a parameter query, what event should I place it in to keep it from executing each time a page/section is formatted/printed.

ie-I currently placed this routine in the Page event of a report based on a parameter query. It works fine initially, but when I try to change pages, it will run a second time, sending me back to the last page again.
 
I don't think you can put it in the Report itself. I think it needs to be in a form event for the very reasons you are finding out. You could try the Open Event for the Report but that's about the only Event that doesn't refire when you move to another page in a report.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top