0

I have a combo box on a binding control. It is bound to a name column in my dataset. It works like it should, but I need the autocomplet to be able to find names by either first name or last name. For example, if I have two names in the name column,
John Smith and
Bob Jones

My user then types in "Jo", I need the dropdown to have both John Smith and Bob Jones listed. Because J and O are the first characters in both a first name and the last name.

Anyone know how I can do this with autocomplete?

Thnks,
Jason

3
Contributors
3
Replies
15
Views
9 Years
Discussion Span
Last Post by Estella
0

I haven't tried but it is likely tied to your SELECT statement.

try...

WHERE Name LIKE '%" & combobox1 & "%'"

0

I haven't tried but it is likely tied to your SELECT statement.

try...

WHERE Name LIKE '%" & combobox1 & "%'"

I am not using SQL SELECT. I just created a new collection string from a bound table and assigned it to the autocomplete custom source. I could use code to do it, but wanted to know if there was a way to accomplish it through the autocomplete functionality.
Below is my code:

Dim acFirstName As New AutoCompleteStringCollection
For Each dr As DataRow In Me.WaterworksDataSet.Tables("WorkOrders").Rows
     acFirstName.Add(dr.Item("Name").ToString) 
Next
NameTextBox.AutoCompleteCustomSource = acFirstName
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.