forms - Combobox Dependant on Checkbox -
i have been able alter list (or rowsource
) of combobox dependant on whether optionbox has been selected using next code:
private sub optyes_click() options end sub private sub optno_click() options end sub private sub options() select case true case optyes.value = true cmb.enabled = true cmb.rowsource = "=options!a1:a4" case optno.value = true cmb.enabled = false end select end sub
i modify combobox list limited grouping of checkboxes have been selected. if have 10 checkboxes denoting different options, , user selects 4 of them, 4 appear in combobox.
here's how it:
private sub algeria_change() options end sub private sub bangladesh_change() options end sub private sub canada_change() options end sub private sub denmark_change() options end sub private sub options() dim names variant, name variant dim old string names = array("algeria", "bangladesh", "canada", "denmark") old = cmb cmb.clear cmb.enabled = false each name in names if me.controls(name) cmb.additem me.controls(name).caption cmb.enabled = true if name = old cmb.seltext = old end if next name end sub
if need more checkboxes add together name names
, phone call options
when change.
forms excel vba checkbox combobox
No comments:
Post a Comment