G
Guest
I have a program that I want to open a recordset that only contains
information on people in a particular department. The user selects which
department from a combo box on a form. My SQL code works fine in a query but
not when I code it. The lines are
Set db = CurrentDb()
strStaff = "SELECT [tblStaff Data].EmpNo FROM [tblStaff Data]WHERE
((([tblStaff Data].Department)=[forms]![frmDepartmentUpdate].[Combo2]))"
Set recStaff = db.OpenRecordset(strStaff)
recStaff.MoveFirst
Why does the code work in a query nut not in code?
I keep getting the error message saying to few parameters expecting 1
information on people in a particular department. The user selects which
department from a combo box on a form. My SQL code works fine in a query but
not when I code it. The lines are
Set db = CurrentDb()
strStaff = "SELECT [tblStaff Data].EmpNo FROM [tblStaff Data]WHERE
((([tblStaff Data].Department)=[forms]![frmDepartmentUpdate].[Combo2]))"
Set recStaff = db.OpenRecordset(strStaff)
recStaff.MoveFirst
Why does the code work in a query nut not in code?
I keep getting the error message saying to few parameters expecting 1