Hello,
I am trying to generate a string in VBA to combine text with the value of textboxes in the form that is open which will eventually become a file path.
I'm trying the following but keep getting an error message:
Private Sub Button_Click()
Dim NameOfFile as String
NameOfFile = "C:\Users\User1\Documents\" & [Customer Name] & "_" & [Customer ID Number] & ".pdf"
DoCmd.OutputTo acOutputForm, "Customer Form", acFormatPDF, NameOfFile, False, , , acExportQualityPrint
End Sub
The error message that I continue to get is:
Run-time error '2501':
The OutputTo action was canceled.
I'm assuming that there's something slightly off with the syntax.
Any assistance would be greatly appreciated.
Thank you!