Filter

  • Thread starter Thread starter Jeanette Cunningham
  • Start date Start date
I have 2 combo box (cbogroupno and cbocompany) I want this 2 combo box
filter each other
i mean:
When select cbogroupno:
Some result appear
When select cbocompany
Some result appear 'But should use the previous filter

There is an error in this code can you please tell me what the error
i mean:
The 2 combo box not give me good result (the 2 combo box not depend on each
other)

Private Sub sSetFilter()
Dim strFilter As String
If Len(Me.cbogroupno.Value) > 0 Then
strFilter = "GroupNumber = " & Me.[cbogroupno]
End If
If Len(Me.cbocompany.Value) > 0 Then
If Len(strFilter) > 0 Then strFilter = strFilter & " AND "
strFilter = "NameOfClient = """ & Me.[cbocompany] & """"
End If
If Len(strFilter) > 0 Then
Me.[childtotlization].Form.Filter = strFilter
Me.[childtotlization].Form.FilterOn = True
Else
Me.[childtotlization].Form.Filter = ""
Me.[childtotlization].Form.FilterOn = False
End If

End Sub
 
Back
Top