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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

clear field in continuous form

Status
Not open for further replies.

beansmom

Programmer
Aug 24, 2004
35
US
I have a continuous form with a bound check box. This check box is used to choose records to be printed as labels. (I originally tried this as unbound, but it does not work on the continuous form).

My question is, "how do I clear this check box for ALL records when the form is closed?" I found this code

Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "T" Then ctl.Value = 0
Next

when looking through other posts, but it only clears the current record, not ALL records.

Thanks for your help!
 
You will need an update query or such like. For example:
[tt]strSQL="Update tblTable Set TheField=False"
DoCmd.RunSQL strSQL"[/tt]

This will update all records in the table.
 
Thanks Remou!

I created an update query, attached it to the click event of a button, turned off the warnings, added a refrsh and it works great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top