Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a series of linked combo boxes setting up sort parameters

Status
Not open for further replies.

WantsToLearn

Programmer
Feb 15, 2003
147
US
Hello all,

I want to use a series of combo boxes to allow my users to specify a custom sort order. As they select from various fields, I want succeeding comboboxes to display already selected choices first in the list but not be selectable again. Is this doable and if so, can someone point me to get started?

As an example for discussion purposes, let's say that they can select from FName, LName, Address, City, State and PostalCode in any order.

Before any user action:

ComboBox1
FName
LName
Address
City
State
PostalCode

After user selects LName and we go to ComboBox2
LName - 1st in list because user selected it in ComboBox1
FName - rest of list in original order
Address
City
State
PostalCode

After user selects State and we go to ComboBox3
LName - 1st in list because user selected it in ComboBox1
State - 2nd in list because user selected it in ComboBox2
FName - rest of list in original order
Address
City
PostalCode

and so on. I think I can get the lists right, but I would like to show already selected items from prior comboboxes in a different color or make them unselectable so that they are read only. I hope I have asked my question clearly. Thanks in advance for any help, ideas, sugestions, etc!
 
in the combo click event, you need to find out which item is selected. As you always know that the user cannot select items 1 or 2 from combo 3, if this selection is made, then force the user to make another choice.

Otherwise, why not use two controls in the same space to look like one, and place your choices there, so place a label above each combo, with the caption set to the other combo selection.

BB
 
Thanks for the ideas! What I ended up doing was putting the selections in a multiline textbox and removing them from the list. It looks pretty nice. Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top