I have the below code and to link a subform and a form based on the combobox value. I get a data type mismatch on the code highlighted in orange. It is a number field so I am not sure why the error. Also the subform is based on a query. Any help is appreciated.
Private Sub cboEmployee_AfterUpdate()
strSQL = "Select * from dbo_EMPLOYEES1"
Me.tblDays_subform.Form.RecordSource = strSQL
'On Error GoTo combo_cust_AfterUpdate_Err
DoCmd.SearchForRecord , "", acFirst, "[EMP_NB] = " & Str(Nz(Screen.ActiveControl, 0))
Dim rs As DAO.Recordset
Set rs = Me.tblDays_subform.Form.RecordsetClone
If rs.RecordCount = 0 Then
MsgBox ("No overtime for this analyst.")
End If
Me.cboEmployee.Value = Null
cboEmployee.SetFocus
End Sub
Private Sub cboEmployee_AfterUpdate()
strSQL = "Select * from dbo_EMPLOYEES1"
Me.tblDays_subform.Form.RecordSource = strSQL
'On Error GoTo combo_cust_AfterUpdate_Err
DoCmd.SearchForRecord , "", acFirst, "[EMP_NB] = " & Str(Nz(Screen.ActiveControl, 0))
Dim rs As DAO.Recordset
Set rs = Me.tblDays_subform.Form.RecordsetClone
If rs.RecordCount = 0 Then
MsgBox ("No overtime for this analyst.")
End If
Me.cboEmployee.Value = Null
cboEmployee.SetFocus
End Sub