Access 2016 accde "DoCmd.OutputTo acOutputReport, , acFormatPDF..." crashes after 10 minutes

Anonymous
2016-01-24T09:19:56+00:00

Create PDF in accdb is no problem.

Create PDF in accde crashes after 10 minutes.

Command: DoCmd.OutputTo acOutputReport, , acFormatPDF, strOutputFile, False, , , acExportQualityPrint

At first the DoCmd.OutputTo method runs fine.

But if you do 10 minutes nothing (only opened) and then you try to run DoCmd.OutputTo again, access crashes without error.

It seems like a timer-problem, but there is no timer.

Only by acFormatPDF and only with accde. In a accdb-file all is fine.

It is not a problem of the PDF-Software. I checked several PDF-Software-Products. Additional: Parameter Autostart is false.

So the PDF-Software should do no matter.

It is not a Problem of anti-virus-Software. I checked it also without any anti-virus-Software.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

75 answers

Sort by: Oldest
  1. Anonymous
    2016-02-24T21:59:09+00:00

    I have also had this problem.  It is very obscure, but repeatable.

    Was this answer helpful?

    4 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2016-03-30T02:09:08+00:00

    I have made the same kind of observations as NikolausM.  I have discovered that if the app sits idle for 7 minutes and 59 seconds or less, it is able to store the pdf within C:\Temp  .  If it sits idle for 8 minutes and 0 seconds or more, it cannot store the pdf within C:\Temp.  The application simply crashes without error during its attempt to convert the report to pdf, and store it. 

    The time threshold's given are as measured from the moment the application is opened.  So, I have 7 minutes and 59 seconds from the time the application is opened to created and store the pdf, via DoCmd.OutputTo.  After that time, if I attempt it, the app crashes.

    I am running Office Pro Plus 2016 (32 bit) on Windows 10(64 bit).  I am starting an accdb file from a bat file using START and a /runtime flag. 

    In the Form_Open event handler of the applications Display Form , I ask to store the report as a pdf in C:\Temp.  But first, I have the code pause for a set number of seconds, an amount which I varied during my tests.

    Here is a code sample that will give a good idea of how the test was done.

    '**************************************

    Within Display Form:

    Private Sub Form_Open(Cancel As Integer)

        Const secondsToSleep As Long = 479

        testReportToPdfStorage secondsToSleep

    End Sub

    Public Sub testReportToPdfStorage(secondsToSleep As Long)

        Dim millisecToSleep As Long

        Dim fullPathToStoredFile As String

        millisecToSleep = secondsToSleep * 1000

        fullPathToStoredFile = "C:\Temp" + "Statement-" & secondsToSleep & ".pdf"

        PauseExecution millisecToSleep        'a call to a subroutine within libPauseExecution

        DoCmd.OutputTo acOutputReport, "rptBillingStatement", acFormatPDF, fullPathToStoredFile, False, "", 0, acExportQualityPrint

    End Sub

    '**************************************

    'libPauseExecution:  Not much to it

    Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

    Public Sub PauseExecution(lngMilliseconds As Long)

        Sleep lngMilliseconds

    End Sub

    I have looked for clues as to cause in the Windows Event Log, but have found nothing.  In addition, I have done some studying of ProcessMonitor logs, but have come to no conclusion what might be causing this time dependent crash to occur.  This is a very repeatable problem.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-03-30T02:49:12+00:00

    The silent app crash observed isn't limited to calls to

         DoCmd.OutputTo  acOutputReport, "myReport", acFormatPDF ...

    in vba code behind. 

    Similar app crash behavior occurs when built in "report to pdf" export functionality is made use of from the access ribbon.  If too much time has occurred since the app was opened (say 10 minutes or more), an app crash occurs.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2016-04-27T21:02:19+00:00

    This is a very strange problem, the problem was the same with a runtime or full Access, no solution from Microsoft....

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2016-04-27T21:15:05+00:00

    Hi Robert_Simard,

    I am not clear whether you experienced this problem too?  Did you experience this problem? 

    As far as a solution from Microsoft is concerned, I know of none, but I haven't searched much for a solution since March 29th since I'm developing an SSRS (Sql Server Reporting Services) workaround.

    Was this answer helpful?

    0 comments No comments