Hi
I've created a few listboxes before, which have all worked fine, but this one however keeps throwing up an error message.
Can someone help with this, here is my code, and the highlighted section it debugs.
Thanks
I've created a few listboxes before, which have all worked fine, but this one however keeps throwing up an error message.
Run-time error '3464': Data type mismatch in criteria expression
Can someone help with this, here is my code, and the highlighted section it debugs.
Code:
Dim db As Database
Dim rst As DAO.Recordset
Dim sSQL As String
Dim EmpID As Integer
Me.List35.RowSource = ""
EmpID = [Forms]![frmWork_Placement]![Emp_ID]
Set db = CurrentDb()
sSQL = " SELECT Object_ID, Emp_ID, Name1, Name2, Name3, Name4, Name5" & _
" FROM dbo_tblEmpContacts WHERE Emp_ID = '" & EmpID & "'"
[COLOR="Red"]Set rst = db.OpenRecordset(sSQL, dbOpenDynaset, dbSeeChanges)[/COLOR]
Me.List35.AddItem rst![Name1]
Me.List35.AddItem rst![Name2]
Me.List35.AddItem rst![Name3]
Me.List35.AddItem rst![Name4]
Me.List35.AddItem rst![Name5]
rst.Close
Set rst = Nothing
Thanks