?
Solved

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

Posted on 2004-08-20
5
Medium Priority
?
318 Views
Last Modified: 2012-06-27
Hi Experts,

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

Thanks
0
Comment
Question by:indyng
5 Comments
 
LVL 8

Expert Comment

by:arcross
ID: 11851120
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
 
LVL 18

Expert Comment

by:Data-Man
ID: 11851146
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
 
LVL 1

Author Comment

by:indyng
ID: 11851330
Can I do this?

        DoCmd.OpenReport stDocName, acPreview
        DoCmd.RunCommand acCmdZoomFit
0
 
LVL 1

Author Comment

by:indyng
ID: 11851357
This way

        DoCmd.OpenReport stDocName, acPreview
        DoCmd.RunCommand acCmdFitToWindow
0
 
LVL 1

Accepted Solution

by:
IndyBean earned 2000 total points
ID: 11851372
Hi indyng

Yes that is correct:

DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdFitToWindow
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question