Zoom problem

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top