Link to home
Start Free TrialLog in
Avatar of cansevin
cansevin

asked on

Make check box visible only if a specific option is checked

I have an option group that has 8 options. If the first option is selected, I would like two other check boxes to be visible. If the first option is not selected, then the two check boxes would be invisible.

Any ideas?

Thanks,

Chris
Avatar of Steven Harris
Steven Harris
Flag of United States of America image

Are you comfortable with VBA?

Say checkbox1 is your 'control' and checkbox4 and checkbox5 are your 'variables', you could use:

If me.checkbox1=true Then
me.checkbox4.enabled = True
me.checkbox4.enabled = True
else
end if

Open in new window


It is hard to say without verifying the source.
Avatar of cansevin
cansevin

ASKER

Thanks... unfortunately I am not that familiar with VBA. Can I put that code in an event for "After update"

Sorry... I am an idiot at this.
SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
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
ASKER CERTIFIED 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
In most cases, you need to include BOTH sides of the condition.
If Me.fraSelection = 1 Then
    Me.chkFld1.Visible = True
    Me.chkFld2.Visible = True
Else
    Me.chkFld1.Visible = False
    Me.chkFld2.Visible = False
End If

Open in new window


Note that you need to check the value of the option group, NOT individual controls inside the option frame.

If you go with the macro (I don't think it is easier and I never use them), add the false option there.