D
depawl
I have a combo box on a form with a list of employee names. When the
user selects an employee from this combo box, I want it to open a report
of the selected record with info on the selected employee only.
I have the following code in the After Update event of the combo box:
Dim strDocName As String
Dim strWhere As String
strDocName = "EmployeeReport"
strWhere = "[EMPLOYEENAME]=" & Me!EMPLOYEENAME
DoCmd.OpenReport strDocName, acPreview, , strWhere
But when I run it I get the following error message:
Syntax error (missing operand) in query expression '([EMPLOYEENAME]=
John Doe)'
What am I missing?
Thanks.
user selects an employee from this combo box, I want it to open a report
of the selected record with info on the selected employee only.
I have the following code in the After Update event of the combo box:
Dim strDocName As String
Dim strWhere As String
strDocName = "EmployeeReport"
strWhere = "[EMPLOYEENAME]=" & Me!EMPLOYEENAME
DoCmd.OpenReport strDocName, acPreview, , strWhere
But when I run it I get the following error message:
Syntax error (missing operand) in query expression '([EMPLOYEENAME]=
John Doe)'
What am I missing?
Thanks.