check box interaction

  • Thread starter Thread starter smokiibear
  • Start date Start date
S

smokiibear

I'd like to use a check box that will cause a couple of objects on a form
to alternate between visible and not visible. In other words, when the
check box is checked, I want a couple of parameters to be accessible, but
when the check box is unchecked, I don't want the parameters viewable. Can
a check box accomplish this, or am I confined to using a command button or
a toggle button?

Thanks.

Smokii
 
You could hide those other controls or you could even just disable them.

Option Explicit
Private Sub CheckBox1_Click()

Me.TextBox1.Enabled = Me.CheckBox1.Value
Me.CommandButton1.Enabled = Me.CheckBox1.Value
Me.CommandButton2.Enabled = Not (Me.CheckBox1.Value)
Me.Label1.Visible = Me.CheckBox1.Value

End Sub

(I just plopped a couple of controls on a userform and chose .enabled/.visible
at random.)
 
Awesome....didn't know I could add "_click" option to the check box.
Thanks again, Dave

Smokii
 
Take a look at the code window for your form.

At the top of that window, you'll see two dropdowns. If you let your cursor
linger over the left hand dropdown, you'll see a tooltip of "Object". Use the
dropdown to select the object you want.

If you let your cursor linger over the right hand dropdown, you'll see
"Procedure".

If you look at the dropdown options for that object, you'll see all the
procedures you can choose from.
 

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

Back
Top