A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Zoom on print preview



 
 
Thread Tools Display Modes
  #1  
Old April 28th, 2004, 01:34 AM
Steven
external usenet poster
 
Posts: n/a
Default Zoom on print preview

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.

  #2  
Old April 28th, 2004, 06:50 AM
fredg
external usenet poster
 
Posts: n/a
Default Zoom on print preview

On Tue, 27 Apr 2004 17:34:48 -0700, Steven wrote:

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.


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"
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
  #3  
Old April 28th, 2004, 09:11 AM
Steven
external usenet poster
 
Posts: n/a
Default Zoom on print preview

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-----
On Tue, 27 Apr 2004 17:34:48 -0700, Steven wrote:

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.


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"
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.

  #4  
Old April 28th, 2004, 04:47 PM
Van T. Dinh
external usenet poster
 
Posts: n/a
Default Zoom on print preview

You can write a Public Function containing the posted code and use the
"RunCode" Command of the Switchboard to run the Function.

--
HTH
Van T. Dinh
MVP (Access)


"Steven" wrote in message
...
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.



  #5  
Old April 28th, 2004, 05:05 PM
fredg
external usenet poster
 
Posts: n/a
Default Zoom on print preview

On Wed, 28 Apr 2004 01:11:21 -0700, Steven wrote:

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-----
On Tue, 27 Apr 2004 17:34:48 -0700, Steven wrote:

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.


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"
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.


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.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
  #6  
Old April 29th, 2004, 12:55 AM
Steven
external usenet poster
 
Posts: n/a
Default Zoom on print preview

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-----
On Wed, 28 Apr 2004 01:11:21 -0700, Steven wrote:

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-----
On Tue, 27 Apr 2004 17:34:48 -0700, Steven wrote:

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.

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"
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.


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.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.

  #7  
Old April 29th, 2004, 03:42 AM
fredg
external usenet poster
 
Posts: n/a
Default Zoom on print preview

On Wed, 28 Apr 2004 16:55:43 -0700, Steven wrote:

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-----
On Wed, 28 Apr 2004 01:11:21 -0700, Steven wrote:

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-----
On Tue, 27 Apr 2004 17:34:48 -0700, Steven wrote:

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.

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"
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.


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.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.

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.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:12 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.