Set a checkbox state to True with code

D

Del

I have a database that has one table, the table is made up of a couple
columns (Tracking Number, Date Rec, Time Red, Destination, Printed) The
Printed column is a Checkbox.

The database is used to scan shipping tracking numbers receiving into
the dock. The form is a continuous form and the user scans the tracking
numbers of each package.

Once all the tracking numbers have been entered the the user then
clicks on a Print Report button that will print a hard copy for all
tracking numbers entered.

The hard copy report is query driven to only pull records in which a
Printed checkbox is false.

What I would like to do is add some code to Print Report button that
would set all the Printed checkboxes in the table to true.

Thank you in advance for any assisatance.
 
W

Wayne Morgan

To set all of them to True, an Update Query would be the easiest.

Example:
strSQL = "Update TableName SET TableName.Printed = True;"
CurrentDb.Execute strSQL, dbFailOnError
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top