Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / April 2004

Tip: Looking for answers? Try searching our database.

Zoom on print preview

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steven - 28 Apr 2004 01:34 GMT
I am trying to view my reports at 150% and have used the
following code at On Open

DoCmd.OpenReport "rptSubcontractors", acViewPreview
DoCmd.RunCommand acCmdZoom150

but it doesn't work. I keep getting a runtime error 2046
saying zoom150% is unavailable.
Any assistance appreciated.
fredg - 28 Apr 2004 06:50 GMT
> I am trying to view my reports at 150% and have used the
> following code at On Open
[quoted text clipped - 5 lines]
> saying zoom150% is unavailable.
> Any assistance appreciated.

You seem to have placed the code in the Report's Open event.
It doesn't go there.

Place your code in the Form's Command Button click event that is used
to open the report "rptSubContractors"
Signature

Fred
Please only reply to this newsgroup.
I do not reply to personal email.

Steven - 28 Apr 2004 09:11 GMT
The command button for these reports is on a switchboard
page which I cannot access in design view (it keeps
reverting to the page before). When I did insert the code
on the command button in form view, the command was
placed on all pages (eg. button(3) etc). hope this makes
sense.
>-----Original Message-----
>
[quoted text clipped - 13 lines]
>Place your code in the Form's Command Button click event that is used
>to open the report "rptSubContractors"
Van T. Dinh - 28 Apr 2004 16:47 GMT
You can write a Public Function containing the posted code and use the
"RunCode" Command of the Switchboard to run the Function.

Signature

HTH
Van T. Dinh
MVP (Access)

> The command button for these reports is on a switchboard
> page which I cannot access in design view (it keeps
> reverting to the page before). When I did insert the code
> on the command button in form view, the command was
> placed on all pages (eg. button(3) etc). hope this makes
> sense.
fredg - 28 Apr 2004 17:05 GMT
> The command button for these reports is on a switchboard
> page which I cannot access in design view (it keeps
[quoted text clipped - 23 lines]
> that is used
>>to open the report "rptSubContractors"

It makes sense, because you are using that blankety blank Access
generated switchboard.

It would make your programming life much simpler to create your own
switchboard using an unbound form with command buttons. If you use the
Command Button wizard, Access will even create much of the code for
you. Then adding the RunCommand to the button code is very simple.
You control the appearance and functionality of the switchboard.

Using your current switchboard setup, I suggest you create a
sub-procedure in a module:

Public Sub ZoomReport()
DoCmd.OpenReport "ReportName", acViewPreview
DoCmd.RunCommand acCmdZoom150
End Sub

Then change the switchboard, using the switchboard manager,
from the OpenReport command you now have to:
RunCode

Write:
ZoomReport
in the Function Name dialog box.
Signature

Fred
Please only reply to this newsgroup.
I do not reply to personal email.

Steven - 29 Apr 2004 00:55 GMT
Thanks for your reply.
I have posted the code as a public function, and changed
the switchboard manager to run the code. But I am still
having problems and the report will not open, instead
receiving an error message.
grateful further advice.
>-----Original Message-----
>
[quoted text clipped - 50 lines]
>ZoomReport
>in the Function Name dialog box.
fredg - 29 Apr 2004 03:42 GMT
> Thanks for your reply.
> I have posted the code as a public function, and changed
[quoted text clipped - 68 lines]
>>ZoomReport
>>in the Function Name dialog box.
You didn't have to make it a function. A sub is fine.
You'll need to place a breakpoint in the function and run the code.
When it reaches the breakpoint, step through the code one step at a
time.  There is no reason for the report to not open if you have
correctly written and called the sub/function.

Again, my best advice is to create your own switchboard.
Signature

Fred
Please only reply to this newsgroup.
I do not reply to personal email.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.