Select Box

skate

Registered User.
Local time
Today, 19:34
Joined
May 22, 2002
Messages
136
Is it possible for the user to select all records with the check box similtaneously instead of going thru each and every record and checking it off?
 
I am not exactly sure what you are asking but I think that an Update Query is the answer...

I bit more detail on what you are trying to do will probably result in a more detailed and accurate answer...
 
Last edited:
skate,
It is possible. You could create a button or a SelectAll checkbox and then use:

If (Forms![My Form]![MySelectAll]=-1) Then
MsgBox "To unselect a single field you must also unselect this field"
Forms![My Form]![My Other Fields] = -1
Forms![My Form]![My Other Fields]= -1
etc.
EndIf

You may want to consider a CLEAR ALL button as well, to allow users to unselect everything with a single click. Don't for get to include the [MySelectAll] = 0 in the CLEAR ALL statement. You will likely encounter errors if you accidently allow MySelectAll and ClearAll.
 
Sorry, what I meant was I have a checkbox field in my form and if checked that particular record is displayed in a report. But sometimes I may want to check off all the records (say 30 records) and it is kind of a hassle to go thru each one and check it off. I was just wondering if there is a faster way to do this?
 
skate,
If you follow the format that I suggested

'If selected will select all of the other check boxes
If (Forms![My Form]![MySelectAll]=(-1)) Then
Forms![My Form]![My Other Fields] = (-1)
Forms![My Form]![My Other Fields]= (-1)
etc.
EndIf

Meaning that if the user checks this one box, all of the other boxes will automatically be selected!

The problem with this is that it you SELECTALL as a mistake...it would be helpful to have a CLEAR ALL button. That button will do the opposite...it will reset all of the check boxes to 0.

0 = unchecked
-1 = checked

So once you've completed the code for the SelectAll the ClearAll will be the same....except with 0's

I'm sure that their might be a shorter way of doing it, but since this accomplished the task at hand....that's what I use...until someone teaches me something new!
 
the problem is my code would be like this
If (Forms![My Form]![MySelectAll]=(-1)) Then
Forms![My Form]![My Other Fields] = (-1)
EndIf
b/c there is only one check box and in datasheet view you see that one check box for say 30 different records. I want to check yes for all the records.
 

Users who are viewing this thread

Back
Top Bottom