Connecting Tech Pros Worldwide Forums | Help | Site Map

Viewing Reports

Mike
Guest
 
Posts: n/a
#1: Nov 12 '05
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



Allen Browne
Guest
 
Posts: n/a
#2: Nov 12 '05

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]


Squirrel
Guest
 
Posts: n/a
#3: Nov 12 '05

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]


Mike
Guest
 
Posts: n/a
#4: Nov 12 '05

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]


Mike
Guest
 
Posts: n/a
#5: Nov 12 '05

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]


Allen Browne
Guest
 
Posts: n/a
#6: Nov 12 '05

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]


Tym
Guest
 
Posts: n/a
#7: Nov 12 '05

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...


Closed Thread


Similar Microsoft Access / VBA bytes