Question : Filer a form with comobox value

Hi
I have a form used to find a customer.
its based on a query that pulls all customers from the tblCustomers and displays them in a split form in accending order.
I have a combo box cboCounty on the form that is based on a qry that provides a DISTINCT non null list of counties from the same customer table.
I would like the afterdate event of cboCounty to filter the form to display only customers whose county field match that selected in the comobox.
Please help with the code.
Thanks
Pete

1:
2:
3:
4:
Private Sub cboCounty_AfterUpdate()
Me.FilterOn
Me.Filter cboCounty.Value
End Sub

Answer : Filer a form with comobox value

There is another ampersand missing, TLH. The code below should work.

(°v°)
1:
2:
3:
4:
5:
6:
7:
8:
Private Sub cboCounty_AfterUpdate()
    If IsNull(cboCountry) Then
        Me.FilterOn = False
    Else
        Me.Filter = "Country = '" & cboCountry & "'"
        Me.FilterOn = True
    End If
End Sub
Random Solutions  
 
programming4us programming4us