Page 1 of 1

Combobox issue

Posted: Mon Sep 26, 2011 9:24 am
by NewGuy
Hi :)

can any one tell me how to go about this ?

I have a database with a table .. with ex. 4 people in it

ID Name
1 John
2 Peter
3 Joan
4 Sara


On my form i have 4 comboboxes that needs to be filled with the list of all names(same as you would do with databound selection)

But here is the tricky part:

If i in combobox1 choose "John" .. then the rest (3)of the comboboxes should not show "John" .. but should only show the rest of the items that are not selected at all

and if in combobox2 also choose "Sara" .. again ..then the remaining comboboxes should only list what has not been selected previously

The list for thost 2 should then just contain "Peter" and "Joan"

Any help and tips tricks ideas on this would be appreciated greatly !

Thank !!

NewGuy

Re: Combobox issue

Posted: Mon Sep 26, 2011 11:22 pm
by mandai
You could probably share one event between the comboboxes for this.
If you can identify which combobox is the sender of the event, then you can change the SelectedIndex of the other 3 comboboxes until they are not equal.

Re: Combobox issue

Posted: Tue Sep 27, 2011 6:22 am
by NewGuy
mandai wrote:
You could probably share one event between the comboboxes for this.
If you can identify which combobox is the sender of the event, then you can change the SelectedIndex of the other 3 comboboxes until they are not equal.
Hi Mandai

I can easyli identify which combobox the sender of the event .. that will always be "combobox1" .. this one always will be there and has to be filled out .. im not sure how to go about the "selectedIndex" you mentioned .. but i will try and google that .. if you have a few lines of code flying around elaporating this that would be awsome

Thank you for taking the time to answer me :)

NewGuy