By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 900 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

Clearing checks in column of Check Boxes

P: n/a
How can you clear a column of check boxes? In this particular data
base I have a field called "code" and it's the way to choose which
records to print. How can I then clear them in one fell swoop?
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 21 Jan 2004 14:56:32 -0800, ca****@mcn.org (B Blue) wrote:
How can you clear a column of check boxes? In this particular data
base I have a field called "code" and it's the way to choose which
records to print. How can I then clear them in one fell swoop?


Use an update query, or run code behind a command button.

Here's the code behind a command button:
CurrentDb.Execute "Update YourTable Set YourTable.CheckBoxField =
No;", dbFailOnError
--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.
Nov 12 '05 #2

P: n/a

"B Blue" <ca****@mcn.org> wrote in message
news:b5**************************@posting.google.c om...
How can you clear a column of check boxes? In this particular data
base I have a field called "code" and it's the way to choose which
records to print. How can I then clear them in one fell swoop?


You could use the following code:

''''''''''''''''''''''''
Dim ctrl As Control

For Each ctrl In Me.Controls
If (TypeOf ctrl Is CheckBox) Then
ctrl.Value = False
End If
Next
''''''''''''''''''''''''

If you wanted to only untick some boxes, you could set the Tag property of
the tickboxes you wanted unaffected and test for it in code e.g.
If (TypeOf ctrl Is CheckBox) And ctrl.Tag <> "9" Then
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.