How to Set View Percentage in a Report (Zoom)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32633

    How to Set View Percentage in a Report (Zoom)

    I'm currently using Access 2003 on an XP machine.

    When my report opens, the size of the report always seems to be such that it fits a whole page in the window. The View Percentage in the Print Preview toolbar seems to go to a value "Fit" which takes the currently defined size of my window, and fits in a whole page of A4 within that. I don't know if I have used the correct term for the setting on the toolbar, but I know the toolbar at least is called Print Preview.

    I'd prefer to see the report within the window showing at full size (a setting of 100%) as I can't even read what it says when it compresses the whole page into the window. Maximising makes it only slightly larger, and is not a viable solution, but if anyone knows how to set the View Percentage in code then that would be very interesting.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32633

    #2
    I hate it when that happens. I did more searching and discovered it was called Zoom (not View Percentage). With that knowledge I found some helpful articles on the subject.

    It seems there are predefined Zoom constants that can be used with DoCmd.RunComman d. For 100%, as specified in the question, simply use :
    Code:
    DoCmd.RunCommand accmdZoom100
    Did I say simply? Not exactly. It fails if run in the Report_Open() or Report_Activate () event procedures apparently :-( You can run it after the call to open the report though, if you want the logic to be determined outside of the report object itself.

    An alternative approach is to use an undocumented object (ZoomControl) of the report itself (Thanks due to Radu Lascae for his code illustration).

    As yet, I have found no workable way to control this in the code of the report itself. Both approaches seem to require the code to be run externally after the report has been opened. Not very satisfactory from my current perspective, but I expect there's a reason for that somewhere.

    Comment

    Working...