I am trying to run a procedure to print my reports but I am getting a Runtime error 3141 - The Select Statement includes a reserved word or argument name that is misspelled or missing, or the punctuation is incorrect. Here is my code:
any help would be appreciated
Code:
Public Sub RunReports()
Dim strRptFilter As String
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("SELECT qry_EmployeeData_1.EEID, qry_EmployeeData_1.Emp_Name,FROM qry_EmployeeData_1,WHERE (((qry_EmployeeData_1.[Plan ID])=[Forms]![frm_PrintStatements]![cboPlanSelect]));", dbOpenSnapshot)
Do While Not rst.EOF
strRptFilter = "[eeid] = " & Chr(34) & rst![EEID] & Chr(34)
DoCmd.OutputTo acOutputReport, "2013 Incentive Statement Template", acFormatPDF, "C:\desktop\test" & "\" & rst![Emp_Name] & ".pdf"
DoEvents
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
End Sub
any help would be appreciated