Okay, this is way beyond my expertise, I do not know visual basic at all, I'm really guessing with what I have below. I can run macro's, reports and queries, but not visual basic.
I have a report that I would like to export to a folder, and I would like to include the FullName within the naming convention of the PDF. When I run the report it prompts for the Employee ID
Here is what I have so far, I'm getting an error of "Run Time Error 424 object required" on the String Report Name, what am i doing wrong?
Private Sub Create_PDF_Click()
Dim myPath As String
Dim strReportName As String
DoCmd.OpenReport "Report_Salary_Worksheet _Finalized_By_EmpID", acViewPreview
myPath = "W:\COMPENS\PHYSICIANS\Comp Plans\"
strReportName = Report_Salary_Worksheet_Finalized_By_EmpID.[FullName] + ".pdf"
DoCmd.OutputTo acOutputReport, "", acFormatPDF, myPath + strReportName, True
DoCmd.Close acReport, " Report_Salary_Worksheet _Finalized_By_EmpID "
End Sub
I have a report that I would like to export to a folder, and I would like to include the FullName within the naming convention of the PDF. When I run the report it prompts for the Employee ID
Here is what I have so far, I'm getting an error of "Run Time Error 424 object required" on the String Report Name, what am i doing wrong?
Private Sub Create_PDF_Click()
Dim myPath As String
Dim strReportName As String
DoCmd.OpenReport "Report_Salary_Worksheet _Finalized_By_EmpID", acViewPreview
myPath = "W:\COMPENS\PHYSICIANS\Comp Plans\"
strReportName = Report_Salary_Worksheet_Finalized_By_EmpID.[FullName] + ".pdf"
DoCmd.OutputTo acOutputReport, "", acFormatPDF, myPath + strReportName, True
DoCmd.Close acReport, " Report_Salary_Worksheet _Finalized_By_EmpID "
End Sub