even if you share your db, it is arabic and adding code will not work with your form with arabic characters.
Dim strQuery As String
Dim strWhere As String
Dim lngLen As Long
Const conJetDate = "\#mm\/dd\/yyyy\#"
strQuery = "qry_Inspections"
If Not IsNull(Me.cboWorker) Then
strWhere = strWhere & "([nawjory madaa] = """ & Me.cboWorker & """) AND "
End If
If Not IsNull(Me.txtFrom) Then
strWhere = strWhere & "([rekawtyhatnn] >= " & Format(Me.txtFrom, conJetDate) & ") AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "No criteria", vbInformation, "Nothing to do."
With Me.qry_Inspections_subform
Filter = ""
FilterOn = False
End With
Else
roi = 8
strWhere = Left$(strWhere, lngLen)
Debug.Print strWhere
With Me.qry_Inspections_subform.Form
.Filter = strWhere
.FilterOn = True
End With
End If
End Sub
Private Sub namecp_AfterUpdate()
Dim strSQL As String
strSQL = "SELECT Table_info.i, tblManager.strManagerName " & _
"FROM tblManager " & _
"WHERE table_info.id__infoo= " & Me.namecp & _
" ORDER BY Table_infoo.nawycompanyy;"
Me.namecp.RowSource = strSQL
Me.namecp.Requery
End Sub