Resize Upon Activate?

  • Thread starter Thread starter Delker
  • Start date Start date
D

Delker

I am having syntax problems using DoCommand. I need to
have a report window Maximize and resize to 75% upon
Activate. Can anyone provide me with the syntax for entry
into the On Activate field? Thanks!!!

Frank
 
Hi Steve,
Thanks for responding to my inquiry regarding resizing
reports. Your response included just the resizing piece,
rather than the combination of resize and maximize. In
addition, when I enter "DoCmd.RunCommand acCmdZoom75" into
the On Activate field in the report properties, I get an
error that "Access can't find the macro "DoCmd" ".

Can you help further?
Thanks.
Frank
-----Original Message-----
Frank,

DoCmd.RunCommand acCmdZoom75

- Steve Schapel, Microsoft Access MVP
 
Frank,

Sorry for the minimalist response before.

If you want to use a macro, make a macro with a Maximize action,
followed by a RunCommand action, and then in the Command argument box
for the RunCommand action enter Zoom75%. Save and name the macro, and
then enter the macro name in the On Activate property of the report.

If you want to use a VBA procedure instead, enter [Event Procedure] in
the report's On Activate property, and then click the little button to
the right with the ... which will open the Visual Basic Editor window,
with the cursor already placed in a suitable position. So make it like
this...
Private Sub Report_Activate()
DoCmd.Maximize
DoCmd.RunCommand acCmdZoom75
End Sub

- Steve Schapel, Microsoft Access MVP


Hi Steve,
Thanks for responding to my inquiry regarding resizing
reports. Your response included just the resizing piece,
rather than the combination of resize and maximize. In
addition, when I enter "DoCmd.RunCommand acCmdZoom75" into
the On Activate field in the report properties, I get an
error that "Access can't find the macro "DoCmd" ".

Can you help further?
Thanks.
Frank
 
Steve,
Thanks for the clarification! However, upon entering the
RunCommand, and Zoon75% on the second line of the macro, I
get an error that says that "the Command or
Action "Zoom75%" isn't available now." It's acting like
the report isn't open yet, or isn't active yet. Might you
have any additional recommendations or causes for this
error?

(This database was not upgraded from an earlier version,
as described in the text of the error message.)

Frank
-----Original Message-----
Frank,

Sorry for the minimalist response before.

If you want to use a macro, make a macro with a Maximize action,
followed by a RunCommand action, and then in the Command argument box
for the RunCommand action enter Zoom75%. Save and name the macro, and
then enter the macro name in the On Activate property of the report.

If you want to use a VBA procedure instead, enter [Event Procedure] in
the report's On Activate property, and then click the little button to
the right with the ... which will open the Visual Basic Editor window,
with the cursor already placed in a suitable position. So make it like
this...
Private Sub Report_Activate()
DoCmd.Maximize
DoCmd.RunCommand acCmdZoom75
End Sub

- Steve Schapel, Microsoft Access MVP


 
Frank,

The Zoom75% doesn't go in the second line of the macro. It goes in
the Command argument box, towards the bottom of the macro design
window.

- Steve Schapel, Microsoft Access MVP
 
Back
Top