use text box to limit list box items

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

Guest

hello, i have created a form where information from a table (a customer
database) is displayed. however, since it is a large list (800+) i want to
have the following: a list box on the page that lists all the company names
in the list box (which is already present), and a text box where i can type
in all or part of a company name and have only those companies that match
listed in the box. i would prefer it done in real-time as the user types,
but any other ways of getting this to work (ie click a button after typing to
display results) are much appreciated. thanx!
 
Have you considered using a combo box? This is generally the proper usage.
 
sorry i should have more specific: i want one search box on the page, that
will search through a number of different fields (ie company, phone number,
address, etc) and display in a list box the company or companies that match
the criteria. you would then click on the company in the list box to
retrieve the record
 
You could use code in the after update of the text box like:

Dim strSQL as String
strSQL = "SELECT * FROM tblCustomers " & _
"WHERE [company] & [Phone Number] & [Address] & [NutherField] Like '*" &
_
Me.txtSearchText & "*'"
Me.lboNoNameGiven.RowSource = strSQL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top