I'm currently using Microsoft Access 2010. Is there any way to eliminate the SaveAs Dialog Box? After running the command it displays and then when you click cancel it prints the report to the correct location. It's a nuance that it displays every time.
Public Sub PrintReportToPDF(ByRef strReport As String, ByRef FilePathandFileName As String)
On Error GoTo ErrHandler
DoCmd.SetWarnings False
DoCmd.OpenReport strReport, acViewNormal
DoCmd.OutputTo acOutputReport, strReport, acFormatPDF,
FilePathandFileName & ".pdf", False, "", 0, acExportQualityPrint
ExitHere:
DoCmd.SetWarnings True
Exit Function
ErrHandler:
MsgBox Err.Description
Resume ExitHere
End Sub