Hi Guys,
I have the following code to print a copy of a report to a folder using the following code:
Code:
Private Sub buttonPreview_Click()
Dim StrFileName As String
Dim strReport As String
strReport = "rptInvoice_Dispatch_edit"
StrFileName = Me.CustName & "_" & Me.invoice & "_" & Me.df1 & ".pdf"
StrFileName = "C:\Data\temp\" & StrFileName
DoCmd.OpenReport strReport, acViewPreview
Debug.Print
DoCmd.OutputTo acOutputReport, strReport, acFormatPDF, StrFileName, False
The code errors when trying to save the file, but cannot see why as the location exists and looks like the file name is correct, how can I debug to find the problem, as you can see I have added debug print, but no idea where that output would be, I have the immediate window open?
Can anyone advise how I can resolve this please.
Ultimately the file will be saved to a Sharepoint location, but testing locally first.