Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 03-24-2011, 09:36 AM   #1
Summer123
Newly Registered User
 
Join Date: Feb 2011
Posts: 216
Thanks: 72
Thanked 0 Times in 0 Posts
Summer123 is on a distinguished road
Unhappy Select all/Clear all check boxes usine label

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

Summer123 is offline   Reply With Quote
Old 03-24-2011, 12:06 PM   #2
vbaInet
AWF VIP
 
Join Date: Jan 2010
Location: U.K.
Posts: 24,318
Thanks: 0
Thanked 1,986 Times in 1,959 Posts
vbaInet is a glorious beacon of light vbaInet is a glorious beacon of light vbaInet is a glorious beacon of light vbaInet is a glorious beacon of light vbaInet is a glorious beacon of light
Re: Select all/Clear all check boxes usine label

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.
vbaInet is offline   Reply With Quote
Old 03-24-2011, 01:48 PM   #3
Summer123
Newly Registered User
 
Join Date: Feb 2011
Posts: 216
Thanks: 72
Thanked 0 Times in 0 Posts
Summer123 is on a distinguished road
Re: Select all/Clear all check boxes usine label

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...

Summer123 is offline   Reply With Quote
Old 03-24-2011, 02:32 PM   #4
vbaInet
AWF VIP
 
Join Date: Jan 2010
Location: U.K.
Posts: 24,318
Thanks: 0
Thanked 1,986 Times in 1,959 Posts
vbaInet is a glorious beacon of light vbaInet is a glorious beacon of light vbaInet is a glorious beacon of light vbaInet is a glorious beacon of light vbaInet is a glorious beacon of light
Re: Select all/Clear all check boxes usine label

Look into the toggle button then.

Yes it will be as simple as setting the value of each textbox as you've illustrated.
vbaInet is offline   Reply With Quote
Old 03-30-2011, 06:41 AM   #5
Summer123
Newly Registered User
 
Join Date: Feb 2011
Posts: 216
Thanks: 72
Thanked 0 Times in 0 Posts
Summer123 is on a distinguished road
Re: Select all/Clear all check boxes usine label

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
Summer123 is offline   Reply With Quote
Old 03-30-2011, 06:49 AM   #6
vbaInet
AWF VIP
 
Join Date: Jan 2010
Location: U.K.
Posts: 24,318
Thanks: 0
Thanked 1,986 Times in 1,959 Posts
vbaInet is a glorious beacon of light vbaInet is a glorious beacon of light vbaInet is a glorious beacon of light vbaInet is a glorious beacon of light vbaInet is a glorious beacon of light
Re: Select all/Clear all check boxes usine label

You can use the Click event:
Code:
Private Sub Toggle266_Click()
     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.
vbaInet is offline   Reply With Quote
The Following User Says Thank You to vbaInet For This Useful Post:
Summer123 (03-30-2011)
Old 03-30-2011, 06:51 AM   #7
Summer123
Newly Registered User
 
Join Date: Feb 2011
Posts: 216
Thanks: 72
Thanked 0 Times in 0 Posts
Summer123 is on a distinguished road
Re: Select all/Clear all check boxes usine label

nevermind i figured it out.

Summer123 is offline   Reply With Quote
Old 03-30-2011, 06:52 AM   #8
Summer123
Newly Registered User
 
Join Date: Feb 2011
Posts: 216
Thanks: 72
Thanked 0 Times in 0 Posts
Summer123 is on a distinguished road
Re: Select all/Clear all check boxes usine label

oh sorry and thanks for the reply
Summer123 is offline   Reply With Quote
Old 03-30-2011, 06:55 AM   #9
vbaInet
AWF VIP
 
Join Date: Jan 2010
Location: U.K.
Posts: 24,318
Thanks: 0
Thanked 1,986 Times in 1,959 Posts
vbaInet is a glorious beacon of light vbaInet is a glorious beacon of light vbaInet is a glorious beacon of light vbaInet is a glorious beacon of light vbaInet is a glorious beacon of light
Re: Select all/Clear all check boxes usine label

No problemo! You're welcome.

vbaInet is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple check boxes to select records WalterInOz Queries 7 12-14-2009 05:05 AM
Clear all check boxes Wayne Cramer Forms 25 01-23-2009 07:38 AM
one Check Box to select all 15Check boxes dr.bob Forms 1 01-27-2006 05:21 AM
How to Select all Check Boxes with VBA wbwillson Modules & VBA 1 03-24-2003 06:50 AM
Multi-select with check Boxes EmmaW Forms 4 08-06-2001 12:27 AM




All times are GMT -8. The time now is 03:17 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
(c) copyright 2010 Access World