What is the code to open a report and have it displayed as "fit" in a window?

Hi Experts,

I require a code that will open a report and make the report display as fit.

Thanks
LVL 1
indyngAsked:
Who is Participating?
 
IndyBeanConnect With a Mentor Commented:
Hi indyng

Yes that is correct:

DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdFitToWindow
0
 
arcrossCommented:
what do you mean display 'as fit'

This is to open the report in view mode
DoCmd.OpenReport "ReportName", acViewPreview

If what you mean it doesnt fit in th page you have to play with marging in the Page setup menu

Álvaro
0
 
Data-ManCOOCommented:
Put this code behind a button    

    DoCmd.OpenReport "rptReportName"
    DoCmd.Maximize
    DoCmd.RunCommand acCmdZoom75

There isn't a zoom fit, 75% is pretty close

Mike
0
 
indyngAuthor Commented:
Can I do this?

        DoCmd.OpenReport stDocName, acPreview
        DoCmd.RunCommand acCmdZoomFit
0
 
indyngAuthor Commented:
This way

        DoCmd.OpenReport stDocName, acPreview
        DoCmd.RunCommand acCmdFitToWindow
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.