Trouble with Control Toolbox checkboxes and macros

T

the__elf

Hello!

I'm trying to create a form with checkboxes that utilize a "nested"
behavior. For example, you can't mark the "Email Account" checkbox
until you have first marked the "Network Account" checkbox. I see
where I can manipulate the checkbox object's "enabled" property, but
I'm unfortunately at a loss for the macro coding that would toggle
that property.

Does anyone know of a way to accomplish a nested checkbox behavior
without incorporating macros? I'd like to be able to make this form
without having to worry over macro security settings, and the "are you
sure you want to enable macros" mess that end users will eventually
trip on.

If accomplishing this without macros is impossible (which I fear will
be the case), what sort of macro code will it take? It would be along
the lines of "If Checkbox1 = marked, then set Checkbox2 = enabled,"
but I lack the coding and syntax skill to get this to work properly.

Thanks in advance for your assistance!
 
T

the__elf

Okay, I finally stumbled upon some decent resources and the syntax for
adjusting the properties on the checkbox objects. I ended up with
this:

Private Sub CheckBox1_Change()
If CheckBox1.Value = True Then
CheckBox2.Enabled = True
Else
CheckBox2.Value = False
CheckBox2.Enabled = False
End If
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