Zoom problem

W

Wylie C

From a command button on a form I have the following code to open a report:
DoCmd.OpenReport "rptRouteMilesByTen", acViewPreview

In the reports On Open code I want the report to zoom to 100% but I get an
error:

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

I get an error in the RunCommand line of the above code. What's wrong?
Thank you
 
A

Allen Browne

That's too early to run the zoom command.
Even the report's Activate event is too early.

If you open the report programmatically, you could try it after the report
opens:
DoCmd.OpenReport "Report1", acViewPreview
DoCmd.RunCommand acCmdZoom100
 
Top