Select all/Clear all check boxes usine label (1 Viewer)

Summer123

Registered User.
Local time
Today, 14:25
Joined
Feb 9, 2011
Messages
216
Hi,
I know how to do the select all clear all buttons, however is there a way where i would have a lable/text box where when the mouse is over it, it would select all and the mouse is away it would clear all check boxes? Can this be done?

thanks!
Summer
 

vbaInet

AWF VIP
Local time
Today, 18:25
Joined
Jan 22, 2010
Messages
26,374
Why not create a button to Select All and another to Deselect All? Or you can use one toggle button so that when depressed it Selects All and when raised Deselects All.
 

Summer123

Registered User.
Local time
Today, 14:25
Joined
Feb 9, 2011
Messages
216
Yeah I was thinking the same thing but is it on focus and would it be as simple as having the queyname.value = true ir false??? Is there a more complicated code that needs to be written? I want to avoid using 2 buttons and that the issue...
 

vbaInet

AWF VIP
Local time
Today, 18:25
Joined
Jan 22, 2010
Messages
26,374
Look into the toggle button then.

Yes it will be as simple as setting the value of each textbox as you've illustrated.
 

Summer123

Registered User.
Local time
Today, 14:25
Joined
Feb 9, 2011
Messages
216
ok so when i use the toggle button, i can get it to select all but how do i clear it when i click off again... is it the lostfocus event?
Private Sub Toggle266_GotFocus()
chkbox1.Value = True
End Sub
 

vbaInet

AWF VIP
Local time
Today, 18:25
Joined
Jan 22, 2010
Messages
26,374
You can use the Click event:
Code:
Private Sub Toggle266_[COLOR=Red]Click[/COLOR]()
     chkbox1.Value = Me.Toggle266.Value
End Sub
When the button is depressed its value is -1 and when raised it's 0 so you can assign it to the checkbox value directly.
 

Users who are viewing this thread

Top Bottom