Passing a parameter from VB6 to Access 2000 via the OpenReport method
Posted on 2002-06-05
I am attempting to print an Access 2000 report from VB6. The report requires one parameter. I use the Access object's DoCmd.OpenReport method, passing the parameter in the wherecondition. I get the following error message:
Run-time error '3075':
Syntax error (missing operator) in query expression '(EmployeeName = Aimee S)'
Can anyone help with my syntax problem?
My code reads:
strWhere = "EmployeeName = " & cboEmployeeMaster(0).Text
.Visible = True
.DoCmd.OpenReport "GroupByEmployee Report", acViewPreview, , strWhere