Zoomcontrol property of Reports collection

G

Guest

The following code is failing with error 2455 ("You entered an expression
that has an invalid reference to the property ZoomControl")

DoCmd.OpenReport "rptTAD", acViewPreview
Reports("rptTAD").ZoomControl = ReportZoomPercent
DoCmd.OpenReport "rptNotification", acViewPreview
Reports("rptNotification").ZoomControl = ReportZoomPercent

Is the above code valid? the zoomcontrol property does not appear in
prompting. I have also seen used code like:
DoCmd.RunCommand acCmdZoom75
Is this a better way?
 
F

fredg

The following code is failing with error 2455 ("You entered an expression
that has an invalid reference to the property ZoomControl")

DoCmd.OpenReport "rptTAD", acViewPreview
Reports("rptTAD").ZoomControl = ReportZoomPercent
DoCmd.OpenReport "rptNotification", acViewPreview
Reports("rptNotification").ZoomControl = ReportZoomPercent

Is the above code valid? the zoomcontrol property does not appear in
prompting. I have also seen used code like:
DoCmd.RunCommand acCmdZoom75
Is this a better way?

Is that the Zoom you want, Zoom75?

DoCmd.OpenReport "rptTAD", acViewPreview
DoCmd.RunCommand acCmdZoom75
DoCmd.OpenReport "rptNotification", acViewPreview
DoCmd.RunCommand acCmdZoom75

Available are Zoom10, 25, 50, 75, 100, 150, 200, 500, 1000, as well as
acCmdFitToWindow.
 
M

Marshall Barton

mscertified said:
The following code is failing with error 2455 ("You entered an expression
that has an invalid reference to the property ZoomControl")

DoCmd.OpenReport "rptTAD", acViewPreview
Reports("rptTAD").ZoomControl = ReportZoomPercent
DoCmd.OpenReport "rptNotification", acViewPreview
Reports("rptNotification").ZoomControl = ReportZoomPercent

Is the above code valid? the zoomcontrol property does not appear in
prompting. I have also seen used code like:
DoCmd.RunCommand acCmdZoom75
Is this a better way?


The ZoomControl property seemed to work in my tests, but it
is undocumented and therefore not garanteed to be reliable.

Fred's reply is the traditional, though less flexible, way
to zoom a report preview.
 

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