0

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.

3
Contributors
6
Replies
9
Views
6 Years
Discussion Span
Last Post by Naveed_786
0

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 by Hisham-Usif: n/a

0

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

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

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 by Luc001: n/a

This question has already been answered. 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.