how do I unmark a record that has been printed

C

Cogaman

We have a table that has one field that is used to identify if that record
has been printed.

Currently, we have a query that identifies all records that do have the
'Print' option checked.

If it does, the users prints a report for each record and then goes back
into the database to uncheck the 'print' option.

I would like to create a button or macro to run once the report has been
printed that would uncheck the 'print' option for each record that is
checked off.

Is this possible to do?

Any ideas?

Thanks!
 
J

John Spencer

USe an update query. What is the field type? Assuming a yes/no field then
your code for a button might look like the following.

Private Sub SomeButton_Click()
Dim strSQL as String
Dim dbAny as DAO.Database

set dbAny = CurrentDb()
StrSQL = "UPDATE [YourTable] SET [YourField] = 0"
dbAny.Execute StrSQL
Msgbox "Cleared " & dbany.recordsaffected & " records",,"Clear Print"

set dbAny = Nothing

End Sub


John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
A

Al Campagna

Cogaman,
You'll need to create an Update query that uses this criteria against
the (ex. ToBePrinted) field...
= True
In the UpdateTo, indicate False.
OR
Even easier, an update query that sets ALL the ToBePrinted values to
False

I'd suggest that you not run this "automatically" (ex. on the Report
Close event). If anything goes wrong with the print out (jams, out of ink,
etc...) the user will have to go back and recheck all the records again
before re-running the report.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 

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