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
Microsoft Access

Avatar of undefined
Last Comment
PatHartman

8/22/2022 - Mon
Steven Harris

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.
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
Rey Obrero (Capricorn1)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Steven Harris

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
PatHartman

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.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck