Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering a form by textbox 1

Status
Not open for further replies.

integritycare

Technical User
Mar 12, 2011
151
AU
Hi ,

Have a question on filtering a continuous form by using the on event (click).
There is a textbox on the form (company) in which the user wants to be able to filter the form so that only that company will appear on the form.
At present there is a combo box that is used to select the companies.

How can this be done? the form name is "Email"

Thank you

Integrity
 
Which "on event (click)" do you want to program?

Are you suggesting you have a continuous form with a text box named Company and when you click in this text box, you only want to display records with the same company value? If so, the code might look like:

Code:
Private Sub Company_Click()
    Me.Filter = "Company = """ & Me.Company & """"
    Me.FilterOn = True
End Sub

Duane
Hook'D on Access
MS Access MVP
 
There is a textbox on the form (company) in which the user wants to be able to filter the form so that only that company will appear on the form

Why would you want a textbox and not a combobox? Makes no sense to me if you are looking for a specific company. Seems more work on the user and provides far less utility. It would only make sense if you wanted to return several related company names like all companies. But if you want a specific company it is easier to pull from a list. Plus it has autocomplete anyways.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top