Link to home
Start Free TrialLog in
Avatar of JSSenior
JSSeniorFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Combobox selection driving another combobox

Hi im using the following code which should basically only make Combo2 visible if Combo1's selection is not "insurance".  This code is on the AfterUpdate but does not work can someone point out where im going wrong?  Cheers    

Also could I add some code which drives the values that are available in Combo2's dropdown based on the User Selection in Combo1.

    If Combo1.value = "Insurance" Then
        Combo2.Visible = False
    Else
        Combo2.Visible = True
    End If
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Forgot to mention:

Most UI experts agree that hiding/showing controls based on user selections is confusing and disconcerting to users. You are generally far better off enabling or disabling controls in those instancees. The exception to this would be if a control should only be shown to specific "groups" - for example, members of a Managers Group should be able to see ButtonA, but no one else should see that button. In those cases it's fine to hid controls.
Avatar of JSSenior

ASKER

Great that works, thank you.  How about the second part of the question can I also drive the list of values that will be available in the dropdown on Combo2 depending on the value in Combo1?
Pete's solution should answer that...
http:#a36501858
Hi points value increased as my question had two parts.

As there is only a few options could I just list them in the VBA code?



SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial