UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Set the zoom percentage in a report    
 
   
balaji
post Dec 3 2006, 09:30 PM
Post#1


UtterAccess VIP
Posts: 5,637
Joined: 23-January 03
From: Chicagoland, USA


Hi,
How do I set the zoom percentage of a report as it appears in preview mode using VBA? I tried docmd.runcommand accmdzoom150 on the report open() as well as the page() events. In both those places, it generated a runtime error (error #2046, the command is not available now). Two questions:
1. How do I set the zoom percentage to one of the numbers represented by the accmdzoom constants (10, 25, 50, 75, 100, 150 and 200)?
2. More importantly, how do I set the zoom to "fit to window"? There does not even seem to be a constant to represent this percentage (unless accmdzoombox is the one).
Thank you.
Go to the top of the page
 
niesz
post Dec 3 2006, 09:37 PM
Post#2


Utter A-fishin'-ado
Posts: 17,958
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((°>


Try this.
Go to the top of the page
 
R. Hicks
post Dec 3 2006, 09:38 PM
Post#3


UA Forum Administrator
Posts: 40,467
Joined: 8-February 00
From: Birmingham, Alabama USA


See the information at the link below ...
Set Custom Zoom for Report Previews
RDH
Go to the top of the page
 
freakazeud
post Dec 4 2006, 07:28 AM
Post#4


UtterAccess VIP
Posts: 31,413
Joined: 23-September 04
From: NC, USA


Hi,
you have to run the code immediately after your OpenReport() method e.g.:

DoCmd.OpenReport ...
DoCmd.RunCommand acCmdFitToWindow

Just for info this is a list of all possible options:

acCmdZoom10
acCmdZoom100
acCmdZoom150
acCmdZoom200
acCmdZoom25
acCmdZoom50
acCmdZoom75
acCmdSizeToFit

HTH
Good luck
Go to the top of the page
 
balaji
post Dec 4 2006, 12:01 PM
Post#5


UtterAccess VIP
Posts: 5,637
Joined: 23-January 03
From: Chicagoland, USA


Thanks a lot, Walter. So, I have to wait till the report is fully open before I set the zoom percentage. Good to know that. And there are so many of these constants associated with runcommand that it is difficult to find the one you are looking for. I was looking at things that begin with zoom when this option is all by itself under fittowindow. The naming convention of these constants needs to be looked at again!
Go to the top of the page
 
balaji
post Dec 4 2006, 12:04 PM
Post#6


UtterAccess VIP
Posts: 5,637
Joined: 23-January 03
From: Chicagoland, USA


Zoomcontrol... Now, I can't find zoomcontrol in the object browser, intellisense does not seem to know about it. But it works. What underground reference book do I have to get that documents these kinds of hidden properties?
Thanks a lot for the reference.
Go to the top of the page
 
balaji
post Dec 4 2006, 12:07 PM
Post#7


UtterAccess VIP
Posts: 5,637
Joined: 23-January 03
From: Chicagoland, USA


Thanks for your response, Freak. What is difference between SizeToFit and FitToWindow?
Go to the top of the page
 
niesz
post Dec 4 2006, 12:18 PM
Post#8


Utter A-fishin'-ado
Posts: 17,958
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((°>


NP.
Ricky knows all of those undocumented commands! wink.gif
Go to the top of the page
 
freakazeud
post Dec 4 2006, 02:11 PM
Post#9


UtterAccess VIP
Posts: 31,413
Joined: 23-September 04
From: NC, USA


Hi,
"acCmdFitToWindow" fits the print preview in the available window, whereas "acCmdSizeToFit" changes the size of controls to best fit on the object.
HTH
Good luck
Go to the top of the page
 
balaji
post Dec 4 2006, 02:26 PM
Post#10


UtterAccess VIP
Posts: 5,637
Joined: 23-January 03
From: Chicagoland, USA


Interesting. I guess I could have created a report 30 inches wide and just let access do whatever it needs to do to fit it on one page rather than going blind moving all my controls by the twip to get everything to fit in a 10" wide report.
Go to the top of the page
 
freakazeud
post Dec 4 2006, 02:45 PM
Post#11


UtterAccess VIP
Posts: 31,413
Joined: 23-September 04
From: NC, USA


I guess wink.gif
Go to the top of the page
 
R. Hicks
post Dec 4 2006, 07:17 PM
Post#12


UA Forum Administrator
Posts: 40,467
Joined: 8-February 00
From: Birmingham, Alabama USA


I actually found this several years ago .. and have used it quite a bit.
Ocan not take credit for writing the solution ....
DH
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    18th December 2017 - 03:50 AM