Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear True/False Fields

Status
Not open for further replies.

Lotek02

Technical User
Apr 30, 2002
10
0
0
US
I have two Columns of True/False Check Boxes that need to be Cleared out Daily by some Very nontechnical People now if it were only a few It would be easy enough to just go in and clear each one out Separatly but there are alot of rows is there an easier way to do this. or is there a way to set it to a date so each day it clears itself?

Thanks a Million
Lotek
 
create a query and edit the SQL to read
UPDATE tablename
SET truefalsecolumn1 = 0,
truefalsecolumn2 = 0
WHERE someconditionistrue

If you want it to clear the whole table you don't need to include the where clause.

Then all they have to do is double click the query and say ok to "you are about to do something..." dialog.

JHall
 
Hi!

You can make a button called clear form and you can use the following code in the click event:

Dim cntl As Control

For Each cntl In Me.Controls
If cntl.ControlType = acCheckBox Then
cntl.Value = False
End If
Next cntl

hth
Jeff Bridgham
bridgham@purdue.edu
 
Dim rst As DAO.Recordset

----- SELECT ONE OF THE FOLLOWING TWO ALT METHODS
Dim strSQL As String
strSQL - "SELECT Val1, Val2 FROM YourTableName;"
Set rst = db.OpenRecordset(strSQL)
OR
Set rst = Me.RecordsetClone
-------------------------------------------

If rst.RecordCount = 0 Then
Set rst = Nothing
Exit Sub
Else
rst.MoveFirst
End If

Do While Not rst.EOF
rst.Edit
rst!Val1 = False
rst!Val2 = False
rst!Update
DoEvents
rst.MoveNext
Loop

rst.Close
Set rst = Nothing

Steve King Growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top