View Size?

  • Thread starter Thread starter Rick
  • Start date Start date
R

Rick

I have some reports that I view on screen, I want the
view size to be 100%, how do I do this? I have put in the
code to DoCmd.Maximize which puts the screen shot to full
size of screen but the report is set to fit window
somewhere and I don't know how to get it to be 100%.
Thanks,
Rick
 
Rick said:
I have some reports that I view on screen, I want the
view size to be 100%, how do I do this? I have put in the
code to DoCmd.Maximize which puts the screen shot to full
size of screen but the report is set to fit window
somewhere and I don't know how to get it to be 100%.
Thanks,
Rick

Are you sure you don't have that backwards? By default every version of
Access I've ever used has defaulted to 100% and I had to use code to have
reports open to "Fit to Window".

Regardless, the problem is that you cannot call code to change the zoom
level from inside the report itself. If you are opening the report from
code (like from a command button) then you can add a line after
DoCmd.OpenReport that sets the zoom level.

DoCmd.OpenReport "ReportName", acViewPreview
DoCmd.RunCommand acCmdFitToWindow

or

DoCmd.OpenReport "ReportName", acViewPreview
DoCmd.RunCommand acCmdZoom100

The constants you can use in the above for zoom levels are...

acCmdZoom100
acCmdZoom10
acCmdZoom150
acCmdZoom200
acCmdZoom25
acCmdZoom50
acCmdZoom75
 
Try
Dim stDocName As String

stDocName = "Report1"
DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdZoom100

Jim
 
Rick said:
I have some reports that I view on screen, I want the
view size to be 100%, how do I do this? I have put in the
code to DoCmd.Maximize which puts the screen shot to full
size of screen but the report is set to fit window
somewhere and I don't know how to get it to be 100%.


Right after the OpenReport statement, use

DoCmd.RunCommand acCmdZoom100
 
Okay I tried all of the above and I get a Run-time error
2046
The command or action zoom 100% isn't available now.
so the report still opens full screen but is size to fit
screen. I can manualy zoom to 100% but would like it to
happen automaticly.
Thanks Rick
 
Either something funny is going on, or your situation is
unusual. Since all three responses to your question suggest
doing the same thing, it's fairly safe for you to assume
that that is the standard way to do what you want. If it
did not work, then there is probably something getting in
the way. One thing that comes to mind is if the report were
already open when you used the OpenReport method, but there
might be other possibilities??
 
I agree, one thing I noticed is that the report seems to
open to 100% view then goes to the size to fit screen. I
am using windows XP.
Thanks Rick
-----Original Message-----
Either something funny is going on, or your situation is
unusual. Since all three responses to your question suggest
doing the same thing, it's fairly safe for you to assume
that that is the standard way to do what you want. If it
did not work, then there is probably something getting in
the way. One thing that comes to mind is if the report were
already open when you used the OpenReport method, but there
might be other possibilities??
--
Marsh
MVP [MS Access]


Okay I tried all of the above and I get a Run-time error
2046
The command or action zoom 100% isn't available now.
so the report still opens full screen but is size to fit
screen. I can manualy zoom to 100% but would like it to
happen automaticly.
Thanks Rick

.
 
Rick said:
I agree, one thing I noticed is that the report seems to
open to 100% view then goes to the size to fit screen. I
am using windows XP.


It sounds like there's some code somewhere that's forcing
the report to fit the window. Try searching the report,
form and ??? modules for
"acCmdSizeToFit"

which, AFAIK, is the only way to get what you're seeing.
Maybe there's some way I'm not aware of to save the report
with that option preset??
 
Back
Top