Hi guys,

I want to search a customer when i press an alphabet 'a' it should search and show drop down list of all customer those name start with 'a'.

Please please help thanks in advance.

You need to fill the AutoCompleteSource of the textbox with the names of the customers. This can be done by a for loop.

Follow this:
Set the AutoCompleteSource property of the textbox to CustomSource and the AutoCompleteMode property to Suggest.
Then write this in the Load Event of the form.

YourTextBox.AutoCompleteCustomSource.Clear

For i As Integer = 0 to (YourDataSet.Tables("Table").Rows.Count-1)
  YourTextBox.AutoCompleteCustomSource.Add(YourDataSet.Tables("Table").Rows(i).Item(Required)
Next i

You can experiment with the AutoCompleteModes to see which one mostly suits you're requirements.

Edited 6 Years Ago by Hisham-Usif: n/a

i am getting error on (required) is not declared.

YourTextBox.AutoCompleteCustomSource.Add(YourDataSet.Tables("Table").Rows(i).Item(Required)

Hi,

If your using that part of code like this:

YourTextBox.AutoCompleteCustomSource.Add(YourDataSet.Tables("Table").Rows(i).Item(Required)

Then of course you have some difficulties:

What's the name of your textbox....
What's the name of your Dataset....
What's the name of your Table....
Required.....

Change that and see what's happening with the Error...

Edited 6 Years Ago by Luc001: n/a

This question has already been answered. Start a new discussion instead.