search for a string and display in a list box

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

Guest

Experts, I need help with this. when you enter a string on a form, i want to
display all the company names that have part of the string in a list box.
Thank you in advance
 
fifi said:
Experts, I need help with this. when you enter a string on a form, i want to
display all the company names that have part of the string in a list box.


You can set the list box;s RowSource query to something
like:

SELECT companyname FROM companies
WHERE companyname Like "*" & Me.textbox & "*"

And add a line of code to the text box's After update event:

Me.listbox.Requery

If your situation is too complex for that to do the job,
then you can construct the row source query on the fly.
 
Back
Top