I have a microsoft database access and I'm trying to filter some records. This is what I do:
1. I have a form for query purposes, in tha form I have also a combo box which I use to select the name of the employee
2. I have another button to filter the records selected in that combobox, but when filtering, sometimes for some specific names is bringin me on ly th records for that name and for other names is bringing me 3, 4 or 5 more names, why? Here is an example of my filter code, any help would be kindly appreciated. thanks
Private Sub cmdFilter_Click()
Dim strWHERE As String
Dim lngLen As Long
Const conJetDate = "\#mm\/dd\/yyyy\#"
If Not IsNull(Me.campofiltro5) Then
strWHERE = strWHERE & "([IDAutonumemp] Like ""*" & Me.campofiltro5 & "*"") AND "
lngLen = Len(strWHERE) - 5
If lngLen <= 0 Then
MsgBox "You must filter any criteria", vbInformation, "No filter found."
strWHERE = Left$(strWHERE, lngLen)
Me.Filter = strWHERE
Me.FilterOn = True