VBA: Disable Frame and Radio Buttons based on Another Radio Button Being True

M

Mcasteel

Im not sure how to disable a set of radio buttons (within a frame) base
upon the answer of a previous radio button (value true).

Basically we are looking at

_Question_1:_
Yes (radio button, opt1Yes)
No (radio button, opt2No)

_Question_2:_(If_question_1_is_yes,_I_dont_want_the_option_of_answering_question_2)_
Located in frame 2.
option1Yes
option2No


*So....???
If opt1Yes = true then opt2.disable? or frame2.disable?
 
B

Bob Phillips

Why do you want to do this? When you have a group of radio buttons, as in a
frame, only one can be selected. The problem with disabling the second is
that the user cannot then change their mind, their would only be one button
left.
 
C

crispbd

This post is better suited for the VBA Programming forum, but here i
what you are looking for hopefully:

Step 1) Open the VBA editor, double click the sheet your controls ar
on
Step 2) View Menu -> Code
Step 3) Left Dropdown select Question1's No code, then Yes code

Get something like this: (if No for question 1 is selected, they CA
answer Q2)
-
Private Sub optQ1No_Click()-
OPTQ2YES.ENABLED = TRUE
OPTQ2NO.ENABLED = TRU
-End Sub-

(if YES for question 1 is selected, they CANNOT answer Q2)

-Private Sub optQ1Yes_Click()-
OPTQ2YES.ENABLED = FALSE
OPTQ2NO.ENABLED = FALS
-End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top