help me filter a form using VBA

Joined
Sep 14, 2011
Messages
1
Reaction score
0
i have created a form from scratch to display information from a table, the table shows people's IDnumber, their Name and their tax paying information (other thirty something columns). in the form i have a text box for the search critera and a comand button, i would like to filter the form by using the ID number and the Name so that when i input the id number it would and press the button it would filter out the information for that person only. this is the code i used

Private Sub Command2_Click()
If Me.Text0 = 10 Then
Me.Form.Filter = "NAME = ""DA BREO, JOHN"""
Me.Form.FilterOn = True
End If

this worked but i had to make a code for each person and there are over 850 people so naturally i got an error message saying the code is too large.
could anybody give me a better code to use!
 
Back
Top