Multiple Combox use same list (1 Viewer)

mba_110

Registered User.
Local time
Today, 02:17
Joined
Jan 20, 2015
Messages
280
Hi

I want to do a small exercise in which i am using 8 combo boxes these combo boxes used to hold categories names.

for example each combo box Value list is like 1,2,3,4,5,6,7,8

I want when i select 1 in combo [cbobox1] then in remaining 7 combo box should not show 1 in any of those remaining comboxes, and same for the remaining combo boxes sequence whatever numbers are already selected in combo boxes it should not appear in remaining combo boxes list.

How i can do that any example or sample data if possible.
 

Ranman256

Well-known member
Local time
Today, 05:17
Joined
Apr 9, 2015
Messages
4,337
Why use 8 combos to pick 8 items?, when you can use 1 combo to pick 8 items.
 

mba_110

Registered User.
Local time
Today, 02:17
Joined
Jan 20, 2015
Messages
280
I have eight categories and have score for each category.

tblEvaluationPoints

[ID] PK
[EvaluationID] FK to tblEvaluation PK
[Category]
[Score]

Each EvaluationID have eight categories to score individually for each.

on my form i have eight combo boxes for category and 8 combo boxes for score and it will store the information in tblEvaluation with same EvaluationID that means each evaluation will have 8 rows to determine one evaluation process.

Hence, i dont want to duplicate the categories once, i select one combo box the rest of the combo boxes should not show that category.
 

June7

AWF VIP
Local time
Today, 01:17
Joined
Mar 9, 2014
Messages
5,470
Having multiple fields with same type of data indicates non-normalized database.

It makes what you want to do more difficult. Also complicated by using ValueList instead of table as source for list.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 10:17
Joined
Feb 19, 2013
Messages
16,607
sounds like you are talking about cascading combo's. You can try this

if valuelist for combo1 is '1,2,3,4,5,6,7,8'

then in the combo2 enter event put

me.combo2.rowsource=replace(combo1.rowsource & ",",combo1 & ",","")

for combo3 in the enter event put

me.combo3.rowsource=replace(replace(combo1.rowsource & ",",combo1 & ",",""),combo2 & ",","")

etc

you do need to think about order of events - the above assumes that combos are entered in order and you don't go back and change anything (e.g. select 3 for combo2, 4 for combo3 then go back to combo2 and select 4)

if that can happen you will need code in each combo afterupdate event to reset the following combo's to a null value ready for re-entering

Always work off combo1 rowsource and this should always have the full list
 

Users who are viewing this thread

Top Bottom