PC Review


Reply
Thread Tools Rate Thread

binding checkboxes

 
 
Keri
Guest
Posts: n/a
 
      11th May 2004
Ok here is the issue, I want to have a checkbox that is
dependant on another checkbox. So if checkbox 1 is checked
than checkbox 2 is active, if checkbox 1 is not checked
then checkbos 2 is greyed out and isn't allowed to be
checked. I found that there was a "bound" function in VBA
but I don't know how to use it. please help!

--Keri
 
Reply With Quote
 
 
 
 
Stephen Nyikos
Guest
Posts: n/a
 
      11th May 2004
The bind function refers to the data source for the
objects so you can also set this up to change the data
source with a similar conditional statement. If you've
bound the control to a data source, a valid change in VBA
will change the source at the same time. Just set before
enable/disable.

Private Sub CheckBox1_Click()
'check1 on checked, check2 enabled
If Me.CheckBox1.Value = True Then
Me.CheckBox2.Enabled = true
Else
'check1 not checked, check2 disabled
If Me.CheckBox1.Value = False Then
Me.CheckBox2.Enabled = False
End If
End If
End Sub

>-----Original Message-----
>Ok here is the issue, I want to have a checkbox that is
>dependant on another checkbox. So if checkbox 1 is

checked
>than checkbox 2 is active, if checkbox 1 is not checked
>then checkbos 2 is greyed out and isn't allowed to be
>checked. I found that there was a "bound" function in

VBA
>but I don't know how to use it. please help!
>
>--Keri
>.
>

 
Reply With Quote
 
Melanie Breden
Guest
Posts: n/a
 
      11th May 2004
Hi Keri,

Keri wrote:
> Ok here is the issue, I want to have a checkbox that is
> dependant on another checkbox. So if checkbox 1 is checked
> than checkbox 2 is active, if checkbox 1 is not checked
> then checkbos 2 is greyed out and isn't allowed to be
> checked. I found that there was a "bound" function in VBA
> but I don't know how to use it. please help!


you can use this little Code:

Private Sub CheckBox1_Click()
CheckBox2.Enabled = CheckBox1.Value
End Sub

--
Regards
Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Binding Treeview checkboxes J Microsoft Dot NET 0 22nd Jul 2006 08:15 PM
Binding Checkboxes to MySQL jwitt Microsoft ADO .NET 1 4th Apr 2006 07:47 AM
Binding checkboxes and date time picker [vb.net 2003] Hardik Shah Microsoft Dot NET 7 6th Mar 2006 03:09 PM
About binding checkboxes and multiple row fields modification Albert Smith via .NET 247 Microsoft VB .NET 0 5th Apr 2005 07:07 PM
data binding with labels and checkboxes =?Utf-8?B?Sm9lIEdhaW5lcw==?= Microsoft Dot NET Framework Forms 0 8th Feb 2005 08:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:51 AM.