Connecting Tech Pros Worldwide Help | Site Map

Viewing Reports

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 06:39 PM
Mike
Guest
 
Posts: n/a
Default Viewing Reports

Is there a way for force access to view reports in a magnified view on
opening of the report from VBA?

I am using the following code to open the report

DoCmd.OpenReport ("rptA5SendOut"), acViewPreview

And I would like the report to be viewed at 150% when opened.

Mike



  #2  
Old November 12th, 2005, 06:39 PM
Allen Browne
Guest
 
Posts: n/a
Default Re: Viewing Reports

In the Activate event of the report:
RunCommand acCmdZoom150

Activate fires for preview, but not for print.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Mike" <revemike@hotmail.com> wrote in message
news:401886f8$1@dnews.tpgi.com.au...[color=blue]
> Is there a way for force access to view reports in a magnified view on
> opening of the report from VBA?
>
> I am using the following code to open the report
>
> DoCmd.OpenReport ("rptA5SendOut"), acViewPreview
>
> And I would like the report to be viewed at 150% when opened.
>
> Mike[/color]


  #3  
Old November 12th, 2005, 06:39 PM
Squirrel
Guest
 
Posts: n/a
Default Re: Viewing Reports

Hi Mike,

Try this:

Private Sub cmdOpenReport_Click()

Dim strReport As String

strReport = "Report1"
DoCmd.OpenReport strReport, acPreview
DoCmd.Maximize
DoCmd.RunCommand acCmdZoom150

End Sub


"Mike" <revemike@hotmail.com> wrote in message
news:401886f8$1@dnews.tpgi.com.au...[color=blue]
> Is there a way for force access to view reports in a magnified view on
> opening of the report from VBA?
>
> I am using the following code to open the report
>
> DoCmd.OpenReport ("rptA5SendOut"), acViewPreview
>
> And I would like the report to be viewed at 150% when opened.
>
> Mike
>
>[/color]


  #4  
Old November 12th, 2005, 06:40 PM
Mike
Guest
 
Posts: n/a
Default Re: Viewing Reports

Thanks, again, Allen. What would we do without you? So many time you have
solved my problems over the years.

Mike

"Allen Browne" <AllenBrowne@SeeSig.Invalid> wrote in message
news:4018c446$0$1730$5a62ac22@freenews.iinet.net.a u...[color=blue]
> In the Activate event of the report:
> RunCommand acCmdZoom150
>
> Activate fires for preview, but not for print.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Mike" <revemike@hotmail.com> wrote in message
> news:401886f8$1@dnews.tpgi.com.au...[color=green]
> > Is there a way for force access to view reports in a magnified view on
> > opening of the report from VBA?
> >
> > I am using the following code to open the report
> >
> > DoCmd.OpenReport ("rptA5SendOut"), acViewPreview
> >
> > And I would like the report to be viewed at 150% when opened.
> >
> > Mike[/color]
>
>[/color]


  #5  
Old November 12th, 2005, 06:40 PM
Mike
Guest
 
Posts: n/a
Default Re: Viewing Reports

I have just tried this and got the following message....

Run-time error '2046'

The command or action 'Zoom150% isn't available now

I am running Office 2003 would this make a difference? Do I need any
particular library to be referenced?

Thanks

Mike


"Allen Browne" <AllenBrowne@SeeSig.Invalid> wrote in message
news:4018c446$0$1730$5a62ac22@freenews.iinet.net.a u...[color=blue]
> In the Activate event of the report:
> RunCommand acCmdZoom150
>
> Activate fires for preview, but not for print.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Mike" <revemike@hotmail.com> wrote in message
> news:401886f8$1@dnews.tpgi.com.au...[color=green]
> > Is there a way for force access to view reports in a magnified view on
> > opening of the report from VBA?
> >
> > I am using the following code to open the report
> >
> > DoCmd.OpenReport ("rptA5SendOut"), acViewPreview
> >
> > And I would like the report to be viewed at 150% when opened.
> >
> > Mike[/color]
>
>[/color]


  #6  
Old November 12th, 2005, 06:40 PM
Allen Browne
Guest
 
Posts: n/a
Default Re: Viewing Reports

Yep: looks like Activate it too early to execute the zoom.

Try issuing the command immedately after the OpenReport action, i.e.:
DoCmd.OpenReport ("rptA5SendOut"), acViewPreview
RunCommand acCmdZoom150

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Mike" <revemike@hotmail.com> wrote in message
news:4018fd83$1@dnews.tpgi.com.au...[color=blue]
> I have just tried this and got the following message....
>
> Run-time error '2046'
>
> The command or action 'Zoom150% isn't available now
>
> I am running Office 2003 would this make a difference? Do I need any
> particular library to be referenced?
>
> Thanks
>
> Mike
>
>
> "Allen Browne" <AllenBrowne@SeeSig.Invalid> wrote in message
> news:4018c446$0$1730$5a62ac22@freenews.iinet.net.a u...[color=green]
> > In the Activate event of the report:
> > RunCommand acCmdZoom150
> >
> > Activate fires for preview, but not for print.
> >
> > --
> > Allen Browne - Microsoft MVP. Perth, Western Australia.
> > Tips for Access users - http://allenbrowne.com/tips.html
> > Reply to group, rather than allenbrowne at mvps dot org.
> >
> > "Mike" <revemike@hotmail.com> wrote in message
> > news:401886f8$1@dnews.tpgi.com.au...[color=darkred]
> > > Is there a way for force access to view reports in a magnified view on
> > > opening of the report from VBA?
> > >
> > > I am using the following code to open the report
> > >
> > > DoCmd.OpenReport ("rptA5SendOut"), acViewPreview
> > >
> > > And I would like the report to be viewed at 150% when opened.
> > >
> > > Mike[/color]
> >
> >[/color]
>
>[/color]


  #7  
Old November 12th, 2005, 06:40 PM
Tym
Guest
 
Posts: n/a
Default Re: Viewing Reports

On Thu, 29 Jan 2004 23:33:16 +1100, "Mike" <revemike@hotmail.com>
wrote:
[color=blue]
>Run-time error '2046'
>
>The command or action 'Zoom150% isn't available now[/color]

It could just be you've put Zoom150% instead of Zoom150...


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.