Make check box visible only if a specific option is checked

Posted on 2014-01-03
Medium Priority
Last Modified: 2014-01-04
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?


Question by:cansevin
LVL 18

Expert Comment

by:Steven Harris
ID: 39755309
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
end if

Open in new window

It is hard to say without verifying the source.

Author Comment

ID: 39755346
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.
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 1000 total points
ID: 39755364
use the afterupdate event of the option group, say the name of the option group is "Frame1"

private sub frame1_afterupdate()


end sub

Note: set the visible property of the two check boxes to NO in the design view of the form
LVL 18

Accepted Solution

Steven Harris earned 1000 total points
ID: 39755378
First, select the checkboxes that should be hidden and set the FormatVisible option to No.

Then select the control checkbox and go to Event > After Update ... button > Macro Builder.

Setup something similar to the following:

After Update Control
LVL 41

Expert Comment

ID: 39756510
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
    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.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
If you need to implement application level security in an Access database application or other VBA code, I strongly encourage you to take advantage of Active Directory groups.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

587 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question