Can I 'Fit to Window' during On_Open Event

sambo

Registered User.
Local time
Today, 15:48
Joined
Aug 29, 2002
Messages
289
Is there a method that let's you fit the report to the window when it opens in print preview mode.

Something Like this:
DoCmd.fitwindow

I have DoCmd.Maximize But this only enlarges the window, the report still looks out of sorts in 100% zoom.
 
I'm getting the following error when I use
DoCmd.RunCommand acCmdFitToWindow

Error: the command 'FitToWindow' isn't available now.

I tried inserting the command in the On Open Event and in the Activate Event. Neither worked.
 
Thank you, That worked like a charm.
It's amazing how so many people can have the exact same problems and questions in such a relatively small forum.
 
I needed this code in a report of mine. However, I am using a switchboard to open report. So, I went to the onclick event and cleared the code that switchboard manager wrote and typed this back into the onclick event:

docmd.openreport stCalendar, acPreview
docmd.runcommand accmdzoom100

It gives me this message.

The action or method requires a report name argument.

What does this mean?
 
Is stCalendar a variable name, or the name of the report itself, if its the name of the report try using quotation marks around stCalendar

Like This:

docmd.openreport "stCalendar", acPreview

Instead of

docmd.openreport stCalendar, acPreview
 

Users who are viewing this thread

Back
Top Bottom