Resize Upon Activate?

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
 
D

Delker

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
 
S

Steve Schapel

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
 
D

Delker

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


 
S

Steve Schapel

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
 
D

Delker

Hi,
Sorry, I meant the second line of the event procedure. I
get the same result when entering Zoom75% in the Command
arguement box in the macro. I setup a macro only to
perform this command, entered it into the OnActivate field
in my report, and get the same error mentioned below.
It's indicating that the command isn't currently
available. This seems to be somewhat of a rat's nest, no?

Again, thanks for your help!!!
Frank
-----Original Message-----
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
 
S

SA

Frank:

You have to call the resize (i.e. Docmd.RunCommand) externally from your
report, not from within it. So if you are using macros, then the macros
must first open the report using OpenReport, then call SelectObject to make
sure the report has the focus, then the macro would call the RunCommand
method. Again, pull it outside your report.

If you were running VBA it would look like this from the code that launches
the report:

Docmd.OpenReport "MyReport", acViewPreview
Docmd.SelectObject acReport, "MyReport"
Docmd.RunCommand acCmdZoom75

HTH
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

Delker said:
Hi,
Sorry, I meant the second line of the event procedure. I
get the same result when entering Zoom75% in the Command
arguement box in the macro. I setup a macro only to
perform this command, entered it into the OnActivate field
in my report, and get the same error mentioned below.
It's indicating that the command isn't currently
available. This seems to be somewhat of a rat's nest, no?

Again, thanks for your help!!!
Frank
 

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