Solved

Make check box visible only if a specific option is checked

Posted on 2014-01-03
5
438 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
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 119

Assisted Solution

by:Rey Obrero
Rey Obrero 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 Format > Visible 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 34

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now