Unticking a box - in bulk

davesmith202

Employee of Access World
Local time
Today, 11:48
Joined
Jul 20, 2001
Messages
522
I have a Yes/No box on my Form. I have created a command button so that when I click it, I want it to untick all the Yes/No boxes.

Do I use an Update query? How do I trigger it from code?
 
you click the button.
not a good answer, then explain the question.
sam
 
Well, which bit is unclear? I have a form with records, one field of which has a Yes/No box. I want a command button that when clicked unticks all the boxes. Does that help?
 
you create a button and on the click event you paste in this code:

Private Sub CommandName_Click()
If CheckBox = False Then
CheckBox = True
Else
CheckBox = False
End If
End Sub
 
That is fine for one Tickbox. But I want to do it for all records...
 
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE YourTable SET YourTable .YourField= Yes"
DoCmd.SetWarnings True

HTH

Peter
 

Users who are viewing this thread

Back
Top Bottom