Link to home
Start Free TrialLog in
Avatar of HKFuey
HKFueyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Access output report fails with no error

I have this VBA
            strTempFile = "C:\OrderAck\OrderAck" & strCurrentOrder & Format(Date, "DD-MM-YYYY") & ".pdf"
            DoCmd.OutputTo acOutputReport, "rpt_Automail", "*.pdf", strTempFile, False

Was working fine, now just ends on the Docmd without any error (I do have an err trap)

Anybody got any Ideas?
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Use the constant for the format:

DoCmd.OutputTo acOutputReport, "rpt_Automail", acFormatPDF, strTempFile, False

Open in new window

Avatar of HKFuey

ASKER

I found the issue, If I try open the report manually it threw an error. In the footer there was some formatting code that was based on the number of lines in an order, it crashed when it came across an order with no lines.

So it was the report code that crashed, that's why I got no error.
ASKER CERTIFIED SOLUTION
Avatar of HKFuey
HKFuey
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial