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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disable combo boxes..

Status
Not open for further replies.

drewdaman

Programmer
Aug 5, 2003
302
CA
hello,

was wondering if there is an easy way to do what i want to do..

i have a form. i have 2 SETS of comboboxes. what imean by this is going to be clear in a second.. when i choose a value from a combobox (non-editable), i would like one of four other combo boxes to be disabled. (So, i have a total of 5 combo boxes on my form)

eg..

combox box 1 has values "a" , "b", "c", "d"

i have 4 other combo boxes that hold VALUES FOR "a" , "b", "c", "d".

depending on what is selected in the first combo box, i would like to disable the combo box in the second set (of four).. ie if "a" is selected in the first combbox, then i would like to disable combo box that holds the VALUES for a.

hope this is clear!
thanks!
 
cboMain
cboa
cbob
cboc
cbod

Use the after_update event of the cboMain..

Select case cboMain

Case "a"
cboa.enabled = true
cbob.enabled = false
cboc.enabled = false
cbod.enabled = false
Case "b"
cboa.enabled = false
cbob.enabled = true
cboc.enabled = false
cbod.enabled = false
Case "c"
cboa.enabled = false
cbob.enabled = false
cboc.enabled = true
cbod.enabled = false
Case "d"
cboa.enabled = false
cbob.enabled = false
cboc.enabled = false
cbod.enabled = true

End Select



------------------------
Hit any User to continue
 
thanks for the reply

well.. yeah.. i did that.. was just wondering if there was an easier/better way to do it.. like associating two combo boxes with each other or something like that..

I have one more question tho! is it possible to set the values displayed in teh combo box from an array? i mean.. i realize you can loop through the array and add each item individually. but can you just say, "use this array as the source to populate the combo box"

thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top