Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fit Report to Screen other than acCmdZoom(%)? 1

Status
Not open for further replies.

jdegeorge

Programmer
Mar 19, 2002
1,313
0
0
US
Hi

I have a report that I want to start out in Preview mode, full screen. The only options I could find were to set the zoom to a number like 10,25,50,75, etc. Although "FIT" is an option on the menubar dropdown box, there isn't a command like acCmdZoomFit, just acCmdZoom75, etc.

Does anyone know how to get the report to be viewed as if FIT were clicked on the menubar? Thanks!

Jim DeGeorge [wavey]
 
Rick39

I'm using that too in conjunction with acCmdZoom75. DoCmd.Maximize controls the preview window size to fit the whole monitor screen. The "zoom" command changes the size of the report within the window. Thanks any way!

Jim DeGeorge [wavey]
 
Got it! It's acCmdFitToWindow! Duh! Thanks for trying!

Jim DeGeorge [wavey]
 
I tried that in the Report_Activate event and got the following error message:
Run-time error '2046': The command or action 'FitToWindow' isn't available now.
Any idea why?
 
What version of Access are you using?

Jim DeGeorge [wavey]
 
jrollins

The code doesn't go in the report at all. It goes behind the button that you click to generate the report.

Here's an example of what I have behind the button's OnClick event to PREVIEW the report:

[tt]DoCmd.OpenReport "REPORT NAME", acViewPreview
DoCmd.RunCommand acCmdFitToWindow
DoCmd.Maximize[/tt]

That should do it for you. Hope this helps.


Jim DeGeorge [wavey]
 
Bullseye! I wish I could give you more than one star for that one!
 
Thanks for the star! They're always fun to get...just as much fun as it is to actually be able to help someone out. Glad it worked! Happy programming.

Jim DeGeorge [wavey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top