Preview Size

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way that I can code a report to be previewed in a certain zoom
size? The default is always Fit and I would like to preview in 75%
automatically.

Thanks.
 
Sherry said:
Is there a way that I can code a report to be previewed in a certain zoom
size? The default is always Fit and I would like to preview in 75%
automatically.


Use DoCmd.RunCommand acCmdZoom75

It hink that will work in the report's Activate event. If
not, use it immediately after the OpenReport statement.
 
Hi Marshall,
Thanks for your help but I get this error message Run time 2046 The command
or action "Zoom75%' isn't available now.

I tried the code in the On Activate property, the On Open property and also
the Report_Open section of the code.
 
Sherry said:
Hi Marshall,
Thanks for your help but I get this error message Run time 2046 The
command or action "Zoom75%' isn't available now.

I tried the code in the On Activate property, the On Open property
and also the Report_Open section of the code.

It can't be called from code in the report. You have to execute that on the
line immediately after the line of code that opens the report.
 
Hi, thanks again. However, I am still having trouble. I thought I did put it
in the line that opens the report. In design view of the report, I switched
to code view, chose Report then Open. This is the code I entered.

Private Sub Report_Open(Cancel As Integer)
DoCmd.RunCommand acCmdZoom75
End Sub

If that's not it, how can I view the OpenReport statement? I was not able to
find any code when I used code view.

Thanks again.
 
Hi, thanks again. However, I am still having trouble. I thought I did put it
in the line that opens the report. In design view of the report, I switched
to code view, chose Report then Open. This is the code I entered.

Private Sub Report_Open(Cancel As Integer)
DoCmd.RunCommand acCmdZoom75
End Sub

If that's not it, how can I view the OpenReport statement? I was not able to
find any code when I used code view.

Thanks again.

Sherry,
It does NOT go anywhere in the report.
Do you have a form that you use to open the report, such as a
Switchboard form or a data entry form?
Place that code in the form event that you use to open the report,
i.e. a command button's click event.

DoCmd.OpenReport "ReportName", acViewPreview
DoCmd.RunCommand acCmdZoom75
 
Back
Top