Solved

Make check box visible only if a specific option is checked

Posted on 2014-01-03
5
478 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 250 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 250 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 37

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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
default value of combobox 25 67
ListData refresh onClick 5 44
Looking for advice on how to develop a project database 2 43
Using a combo box to search a form. 3 27
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

738 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