Setting Report's Zoom on open (1 Viewer)

smig

Registered User.
Local time
Tomorrow, 00:04
Joined
Nov 25, 2009
Messages
2,209
How can I set the report's Zoom on open, and set the window size to match the report's zoom?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 14:04
Joined
Oct 29, 2018
Messages
21,469
Hi. You could try something like:
Code:
DoCmd.RunCommand acCmdZoom200
 

smig

Registered User.
Local time
Tomorrow, 00:04
Joined
Nov 25, 2009
Messages
2,209
Hi. You could try something like:
Code:
DoCmd.RunCommand acCmdZoom200
Thanks, but what about the window size ?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 14:04
Joined
Oct 29, 2018
Messages
21,469
Not working :(
I tried Report's Open, Load, Activate events
"Not working" as in, are you getting an error message? If so, what does it say? Otherwise, can you post a sample db to demonstrate what you want to do? Thanks.
 

smig

Registered User.
Local time
Tomorrow, 00:04
Joined
Nov 25, 2009
Messages
2,209
"Not working" as in, are you getting an error message? If so, what does it say? Otherwise, can you post a sample db to demonstrate what you want to do? Thanks.
Sorry

error 2046 - The command or action 'Zoom200%' isn't available now
 

theDBguy

I’m here to help
Staff member
Local time
Today, 14:04
Joined
Oct 29, 2018
Messages
21,469
Sorry

error 2046 - The command or action 'Zoom200%' isn't available now
Hmm, I just tried the following on a form button and it worked for me.
Code:
Private Sub Command0_Click()

DoCmd.OpenReport "Report2", acViewPreview
DoCmd.RunCommand acCmdZoom200

End Sub
Is that what you did?
 

smig

Registered User.
Local time
Tomorrow, 00:04
Joined
Nov 25, 2009
Messages
2,209
Hmm, I just tried the following on a form button and it worked for me.
Code:
Private Sub Command0_Click()

DoCmd.OpenReport "Report2", acViewPreview
DoCmd.RunCommand acCmdZoom200

End Sub
Is that what you did?
No, I tried the Report's Open, OnLoad... events

This is even makes it easier for me as I don't have to change the reports, only the commands open them :)

Thanks
 

smig

Registered User.
Local time
Tomorrow, 00:04
Joined
Nov 25, 2009
Messages
2,209
what is the exact difference between:
acViewNormal
acViewPreview
acViewReport
 

theDBguy

I’m here to help
Staff member
Local time
Today, 14:04
Joined
Oct 29, 2018
Messages
21,469
what is the exact difference between:
acViewNormal
acViewPreview
acViewReport

Hi. Normal sends the report directly to the printer. Preview displays the report before printing. And Report displays it in Layout view.
 

Users who are viewing this thread

Top Bottom