MS Access, control zoom property on Open Reports

G

Guest

Running a Report from docmd. open report whenever opening a report from
default zoom of 100% to 80%. Not sure, how, have tried to it on "on Open
event"
no luck, any help would be appreciated
 
M

Marshall Barton

Running a Report from docmd. open report whenever opening a report from
default zoom of 100% to 80%. Not sure, how, have tried to it on "on Open
event"


Place the line:

DoCmd.RunCmd acCmdZoom75
or
DoCmd.RunCmd acCmdFitToWindow

immediately after the OpenReport line.

Sorry, there's is no option for 80% See RunCommand in Help
for the other options.
 
D

Dirk Goldgar

Richard Tsang said:
Running a Report from docmd. open report whenever opening a report
from default zoom of 100% to 80%. Not sure, how, have tried to it on
"on Open event"
no luck, any help would be appreciated

I'm not sure exactly what you have in mind, but consider this example
routine:

'----- start of example code -----
Sub OpenAndZoomReport(ReportName As String)

On Error GoTo Err_OpenAndZoomReport

DoCmd.OpenReport ReportName, acViewPreview
DoCmd.Maximize
RunCommand acCmdFitToWindow
'**OR** RunCommand acCmdZoom75 ' or other zoom constants

Exit_OpenAndZoomReport:
Exit Sub

Err_OpenAndZoomReport:
MsgBox Err.Description, _
vbExclamation, _
"Error " & Err.Number & " Opening Report"
Resume Exit_OpenAndZoomReport

End Sub

'----- end of example code -----

I've also seen an article on the Access Web that says you can use the
report object's undocuments ZoomControl property to zoom it to an
enormous range of magnifications, not just those with predefined
RunCommand constants. See
http://www.mvps.org/access/reports/rpt0020.htm .
 
D

Dirk Goldgar

Marshall Barton said:
Sorry, there's is no option for 80% See RunCommand in Help
for the other options.

Ah, but that link I posted purports to do that.
 
M

Marshall Barton

"Marshall Barton" wrote
Dirk said:
Ah, but that link I posted purports to do that.


No matter how many times I browse through that site, there
always more that I've missed.

I was having trouble with my Something New Everyday
objective yesterday so your post is doubly welcome ;-)
 

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