Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Make check box visible only if a specific option is checked

Posted on 2014-01-03
5
Medium Priority
?
494 Views
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?

Thanks,

Chris
0
Comment
Question by:cansevin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
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
else
end if

Open in new window


It is hard to say without verifying the source.
0
 

Author Comment

by:cansevin
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.
0
 
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()

me.checkbox1.visible=me.frame1.value=1
me.checkbox2.visible=me.frame1.value=1


end sub

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

Accepted Solution

by:
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
0
 
LVL 39

Expert Comment

by:PatHartman
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
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.
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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…

610 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