Access VBA OutputTo Report error

B. Hata 1 Reputation point
2022-07-27T19:17:18.877+00:00

I have a long time running program where I am now getting an error trying to output a Report to an RTF. This piece of code ran last month, so it appears something has changed in the last month.

DoCmd.OutputTo acOutputReport, "Report43", acFormatRTF, "c:\tmp\xyz.rtf", False  

I tried changing the file format to Text and XLSX with same error results.
In this code, right before this report output, I output a Query to an XLSX without problems. So it appears that it isn't the destination type but of the source type (Report vs. Query).

I get this error on two different computers, both are Windows 7 Pro.
The Access version/build shows as Version 2002 (build 12527.22183 Click-to-Run)

Any assistance would be appreciated.

0 comments No comments
{count} votes

8 answers

Sort by: Most helpful
  1. Gary Guillie 1 Reputation point
    2022-08-01T21:17:23.543+00:00

    Docmd.OutputTo also fails with output to TXT, SNP, HTML, etc. HOWEVER it still works outputting to PDF

    And, again, this process has been working for YEARS with the exact same code. Just started failing within the past few days.

    0 comments No comments

  2. Tom van Stiphout 1,696 Reputation points MVP
    2022-08-01T21:26:41.743+00:00
    0 comments No comments

  3. Gary Guillie 1 Reputation point
    2022-08-02T17:05:19.3+00:00

    Unfortunately that does not address the problem we are seeing. OS Windows 10 Home 10.0.19044 Access 2013 64 bit version 15.0.5423.1000 (Desktop version)

    I did notice that KB5002121 was installed on the pc in question on 7/14/2022 and seems to address security concerns in Office 2013. Perhaps this caused the problem.

    I have tried to install KB5002121 on my own pc but it states that I have no products installed on my pc which are affected by this update.

    Note also that in the "answer" you (@Tom van Stiphout ) mentioned it states that "All other export formats work without issue - .pdf, .rtf, .txt." BUT in my case .RTF fails, .TXT fails, .SNP fails, .HTML fails

    BUT output to PDF works.

    0 comments No comments

  4. B. Hata 1 Reputation point
    2022-08-06T22:56:09.973+00:00

    Thanks to TvanStiphout for the link! At least there's hope that the fix will eventually get applied to Office 2016. For now I configured a Windows 10 computer to run the database as it received the patched update and is working.

    0 comments No comments

  5. Tom van Stiphout 1,696 Reputation points MVP
    2022-08-07T00:41:01.673+00:00
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.