The command button for these reports is on a switchboard
page which I cannot access in design view (it keeps
reverting to the page before). When I did insert the code
on the command button in form view, the command was
placed on all pages (eg. button(3) etc). hope this makes
sense.
It makes sense, because you are using that blankety blank Access
generated switchboard.
It would make your programming life much simpler to create your own
switchboard using an unbound form with command buttons. If you use the
Command Button wizard, Access will even create much of the code for
you. Then adding the RunCommand to the button code is very simple.
You control the appearance and functionality of the switchboard.
Using your current switchboard setup, I suggest you create a
sub-procedure in a module:
Public Sub ZoomReport()
DoCmd.OpenReport "ReportName", acViewPreview
DoCmd.RunCommand acCmdZoom150
End Sub
Then change the switchboard, using the switchboard manager,
from the OpenReport command you now have to:
RunCode
Write:
ZoomReport
in the Function Name dialog box.