A family of Microsoft relational database management systems designed for ease of use.
I have also had this problem. It is very obscure, but repeatable.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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.
A family of Microsoft relational database management systems designed for ease of use.
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.
I have also had this problem. It is very obscure, but repeatable.
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.
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.
This is a very strange problem, the problem was the same with a runtime or full Access, no solution from Microsoft....
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.