Linking combo boxes to filter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to link two combo boxes (i.e. date, and company) to filter to
show a specific record? It seems this can be done on an data access page,
but I want to do it on a form. If not is there another way to search records
on a form where there will be duplicate entries in some fields? (i.e. company
name or date).

Thanks

SianG
 
Use the after_update event for each combo list so that your code modifies
the filter:

Sub Combo1_AfterUpdate
Me.Filter = "Field1 = """ & Combo1 & """" AND Field2 = """ & Combo2 &
"""
Me.FilterOn = True
End Sub

Sub Combo2_AfterUpdate
Combo1_AfterUpdate
End Sub

I probably don't have the quoation marks right but you get the idea. Your
code should trap for missing data in combo 1 or combo 2.

RB
 
Back
Top