Solved

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

Posted on 2004-08-20
5
301 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 500 total points
ID: 11851372
Hi indyng

Yes that is correct:

DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdFitToWindow
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

729 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