Function similar to VLOOKUP in Excel

johncassell

Well-known member
Joined
Jun 10, 2007
Messages
120
Location
Redcar, England
Programming Experience
Beginner
Hi There,

I have looked around various sites and forums for an answer to this but it seems there are various ways and I would like to know the best way to do it..

I have two comboboxes (Customer Name, Customer Label) linked to the same table.

Example Customer Name = "ABC", Customer Label = "Don't use"

I would like it so that if I was to change ABC in the customer name box, it would automatically look in the table to see what the corresponding value of the new entry is and populate the Customer Label combobox.

Hopefully someone can explain best way?

Thanks in advance for any help.

John
 
We actually normally set:

combo.Datasource = the_table
combo.DisplayMember = "Customer Label"
combo.ValueMember = "Customer Name"

then use combo.SelectedValue to retrieve the ABC, or bind .SelectedValue to our Orders.CustomerName table column
 
Back
Top