I am using the following to print a report in pdf to a location on my C drive. A query on which the report is based has a field called [FileNamePart] in [qryLaborCostData].
I would like the file name to be "Task Detail" & [FilenamePart] & ".pdf"
I am getting run time error 2465: MS Access can't find the field '|1' referred to in your expression.
Seems I am having trouble making the reference back to the query field as well as the quotes around the sting components.
Any suggestions please.
thanks
I would like the file name to be "Task Detail" & [FilenamePart] & ".pdf"
Code:
Private Sub Command6_Click()
DoCmd.OutputTo acOutputReport, "Task_Detail", acFormatPDF, "C:\Users\SH\Production\" & "Task Detail" & [qryLaborCostData]![FileNamePart] & ".pdf", acExportQualityPrint
End Sub
I am getting run time error 2465: MS Access can't find the field '|1' referred to in your expression.
Seems I am having trouble making the reference back to the query field as well as the quotes around the sting components.
Any suggestions please.
thanks