I need when a selection is made in any given combobox(s)  the subform will filter

Fordraiders
Fordraiders used Ask the Experts™
on
OFFICE 365 ACCESS
form
subform
comboxes  =  4
tabcontrol

i have 4 comboxes on a form they independent of each other(not cascading).

I have a tab(tabs1,2,3,4)  
For Tab1

What I need:
I need when a selection is made in any given combobox the subform will filter.
if 1 of the comboxes is selected then filter.
if 2 of the comboxes are selected, then filter the subform with those 2 values
....etc  

I have told them to simply use the filter by selection built into access but they want it this way.


suggestions or sample code ?  

Thanks
Fordraiders
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
'; all tab
If Me.TabCtl0.Value = 0 Then
If Nz(Me.Combo26, "<All>") > "<All>" Then   'type
    If Len(Nz(strFilter)) > 0 Then strFilter = strFilter & " And "
    strFilter = strFilter & "Payment_Terms_Compliant = '" & Me.Combo26 & "'"
    bFilter = True
    End If
   
   
If Nz(Me.Combo28, "<All>") > "<All>" Then    'rsvp
    If Len(Nz(strFilter)) > 0 Then strFilter = strFilter & " And "
    strFilter = strFilter & "RSVP_Director = '" & Me.Combo28 & "'"
    bFilter = True
    End If
   
   
If Nz(Me.Combo31, "<All>") > "<All>" Then    'manager
    If Len(Nz(strFilter)) > 0 Then strFilter = strFilter & " And "
    strFilter = strFilter & "Sales_Manager = '" & Me.Combo31 & "'"
    bFilter = True
    End If
   
If Nz(Me.Combo33, "<All>") > "<All>" Then    ' customer name
    If Len(Nz(strFilter)) > 0 Then strFilter = strFilter & " And "
    strFilter = strFilter & "Customer_Name = '" & Me.Combo33 & "'"
    bFilter = True
    End If
   
   
If bFilter Then
   Me.All_ExtendedPaymentTerms_subform.Form.OrderBy = ""
    Me.All_ExtendedPaymentTerms_subform.Form.Filter = strFilter
    Me.All_ExtendedPaymentTerms_subform.Form.FilterOn = True
    Else
    Me.All_ExtendedPaymentTerms_subform.Form.FilterOn = False
    End If

End If

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial