Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Lewes, East Sussex, Sussex, United Kingdom
    Posts
    232
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Docmd.OutputTo (A97 SR2/A2002 SP3)

    Fellow loungers

    I wonder if someone can help with a strange report issue. We have an application which we are in the process of upgrading from A97 to A2002. One part of the functionality is to attach reports to emails (we use Lotus Notes) in various formats. The following line of code :

    DoCmd.OutputTo acOutputReport, strReportName, acFormatXLS, strSheetName, False

    works fine in A97 and opens the report in Preview mode, but in A2002 the same line opens the report in design mode., which is not what we want.

    Can anyone explain this, & suggest how I could easily get round it ?

    Usual thanks for your help

    Nick

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Docmd.OutputTo (A97 SR2/A2002 SP3)

    OutputTo shouldn't open the report at all, just export it to Excel, so I don't understand why it would open the report in preview mode in Access 97 or in preview mode in Access 2002. <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Lewes, East Sussex, Sussex, United Kingdom
    Posts
    232
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Docmd.OutputTo (A97 SR2/A2002 SP3)

    Hans

    Thanks for that. I had a further look at the code. The report is already open in Preview mode, and is then exported to whichever app is chosen (Word, Excel).

    The problem actaully occurred when it was sent to a PDF. The line :

    DoCmd.OpenReport strReport, acViewNormal

    opened the report in Design view in A2002 & left it in Preview mode in A97.

    Changing the line to :

    DoCmd.OpenReport strReport, acViewPreview

    solved the problem.

    Thanks again

    Nick

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •