Link to home
Start Free TrialLog in
Avatar of indyng
indyng

asked on

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
Avatar of arcross
arcross
Flag of United Kingdom of Great Britain and Northern Ireland image

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
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
Avatar of indyng
indyng

ASKER

Can I do this?

        DoCmd.OpenReport stDocName, acPreview
        DoCmd.RunCommand acCmdZoomFit
Avatar of indyng

ASKER

This way

        DoCmd.OpenReport stDocName, acPreview
        DoCmd.RunCommand acCmdFitToWindow
ASKER CERTIFIED SOLUTION
Avatar of IndyBean
IndyBean

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial