ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   check box interaction (https://www.excelbanter.com/excel-programming/319345-check-box-interaction.html)

smokiibear

check box interaction
 
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

Dave Peterson[_5_]

check box interaction
 
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.)



smokiibear wrote:

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


--

Dave Peterson

smokiibear

check box interaction
 
Awesome....didn't know I could add "_click" option to the check box.
Thanks again, Dave

Smokii


Dave Peterson[_5_]

check box interaction
 
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.



smokiibear wrote:

Awesome....didn't know I could add "_click" option to the check box.
Thanks again, Dave

Smokii


--

Dave Peterson


All times are GMT +1. The time now is 01:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com