Viewing Reports

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    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.OpenRepor t ("rptA5SendOut" ), acViewPreview

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

    Mike


  • Allen Browne

    #2
    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@hotma il.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.OpenRepor t ("rptA5SendOut" ), acViewPreview
    >
    > And I would like the report to be viewed at 150% when opened.
    >
    > Mike[/color]


    Comment

    • Squirrel

      #3
      Re: Viewing Reports

      Hi Mike,

      Try this:

      Private Sub cmdOpenReport_C lick()

      Dim strReport As String

      strReport = "Report1"
      DoCmd.OpenRepor t strReport, acPreview
      DoCmd.Maximize
      DoCmd.RunComman d acCmdZoom150

      End Sub


      "Mike" <revemike@hotma il.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.OpenRepor t ("rptA5SendOut" ), acViewPreview
      >
      > And I would like the report to be viewed at 150% when opened.
      >
      > Mike
      >
      >[/color]


      Comment

      • Mike

        #4
        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@Se eSig.Invalid> wrote in message
        news:4018c446$0 $1730$5a62ac22@ freenews.iinet. net.au...[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@hotma il.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.OpenRepor t ("rptA5SendOut" ), acViewPreview
        > >
        > > And I would like the report to be viewed at 150% when opened.
        > >
        > > Mike[/color]
        >
        >[/color]


        Comment

        • Mike

          #5
          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@Se eSig.Invalid> wrote in message
          news:4018c446$0 $1730$5a62ac22@ freenews.iinet. net.au...[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@hotma il.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.OpenRepor t ("rptA5SendOut" ), acViewPreview
          > >
          > > And I would like the report to be viewed at 150% when opened.
          > >
          > > Mike[/color]
          >
          >[/color]


          Comment

          • Allen Browne

            #6
            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.OpenRepor t ("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@hotma il.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@Se eSig.Invalid> wrote in message
            > news:4018c446$0 $1730$5a62ac22@ freenews.iinet. net.au...[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@hotma il.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.OpenRepor t ("rptA5SendOut" ), acViewPreview
            > > >
            > > > And I would like the report to be viewed at 150% when opened.
            > > >
            > > > Mike[/color]
            > >
            > >[/color]
            >
            >[/color]


            Comment

            • Tym

              #7
              Re: Viewing Reports

              On Thu, 29 Jan 2004 23:33:16 +1100, "Mike" <revemike@hotma il.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...


              Comment

              Working...