Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Userform Question

Status
Not open for further replies.

LGMan

MIS
Aug 27, 2003
233
GB
Hi,
I'd like to create a userform with a checkbox and 2 option buttons.
Is it possible to have the options buttons inactive until the checkbox is ticked.

The requirement behind this is to use a checkbox with an instruction/warning so that the end user confirms before the option button choices become available.

If this is not possible, then I'll perhaps look at a 2 userform option, unless there is a completely better way to address this requirement

Any tips or pearls of wisdom gratefully received.

Thanks in advance.
 



Hi,

Check out the Enabled property or the Visible property.

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
On form load, set the option buttons to enabled = false

On checkbox click, check value of checkbox. If true then set option buttons to enablesd, else set to enabled=false

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thanks Skip/Geoff,
One other question, which property can I use to toggle the tick within a checkbox
 
The Value property.

Hope this helps

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 



This is a question that you could find the answer yourself using faq707-4594, for instance...
Code:
Sub toggle()
    If CheckBox1.Value Then
        CheckBox1.Value = False
    Else
        CheckBox1.Value = True
    End If
End Sub


Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
If you just want the option buttons to be enabled/disabled if the checkbox is ticked/unticked I'd use something like this:
Code:
Private Sub CheckBox1_Click()
OptionButton1.Enabled = CheckBox1.Value
OptionButton2.Enabled = CheckBox1.Value
End Sub
Hope this helps

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
HarleyQuinn - that's my 2nd favourite episode of Southpark! Only beaten by Christmas Critters!

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
It's one of my favourite episodes as well Geoff, I'd also forgotten about the Christmas Critters one, thanks for reminding me! [smile]

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top