By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,226 Members | 1,435 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,226 IT Pros & Developers. It's quick & easy.

How to show items in list box beginning with characters typed by user

P: 48
I have a list box which contains a list a customers in the database. i want the list box to show the names of customers that start with the letters entered by the user.
Dec 12 '11 #1

✓ answered by Seth Schrock

You have two options. You could create a query and then select that query as the row source for the listbox or you can type the SQL code into the row source. Either way, you get the same results. The only code that you could put into the textbox is in the after update event that requeries the list box. For example,
Expand|Select|Wrap|Line Numbers
  1. Me.{listbox name}.Requery

Share this Question
Share on Google+
4 Replies


Seth Schrock
Expert 2.5K+
P: 2,951
Check out the the following discussion about a similar question. Advanced Search Form and see if that answers your question. If you have further questions, feel free to ask.
Dec 13 '11 #2

P: 48
I Put the code in the TxtPartial_Enter Sub but it didn't work. i did't put anything in the rowsource property of the list box. do i need to set it to strSql. thanks
Dec 13 '11 #3

Seth Schrock
Expert 2.5K+
P: 2,951
You have two options. You could create a query and then select that query as the row source for the listbox or you can type the SQL code into the row source. Either way, you get the same results. The only code that you could put into the textbox is in the after update event that requeries the list box. For example,
Expand|Select|Wrap|Line Numbers
  1. Me.{listbox name}.Requery
Dec 14 '11 #4

P: 48
Thanks Seth. it worked fine!
Dec 14 '11 #5

Post your reply

Sign in to post your reply or Sign up for a free account.