How to mark record as printed

S

Steve Vincent

Hi,

I have a check-box field to determine whether or not to print a mailing
label for a person. Once the label is printed, I would like Access to
automatically clear the check-box. Is there a macro that I can create to do
this? Or some other method besides the check-box clearing?

Thanks in advance,
Steve
 
U

UpRider

Steve, here's code I use to do just that.

Dim strSQL As String
strSQL = "UPDATE DISTINCTROW [qDBTCMAST ALPHA] SET [qDBTCMAST
ALPHA].NEEDS_NL = False " & _
"WHERE ((([qDBTCMAST ALPHA].NEEDS_NL) = True));"
CurrentDb.Execute strSQL, dbFailOnError

You could put this code in a command button's click event, run it
automatically each time the database is started, or both.
These lines may break at odd lengths in your reader. The strSQL is 2 lines,
breaking at the end of the underline.

HTH, UpRider
 
L

Larry Daugherty

One, simplistic, way is to use an Update Query. Once printed, run the
query to reset the "ToPrint" bits from a line of code sometime after
the line of code that prints the report.. However, in my world, the
printer can have problems, things can go wrong on an individual report
or a series of them. The real world requires some handy means of
handling those "exceptions". I've interrupted those automatic
routines with a msgbox asking if all printed OK and its alright to
clear the bits.

HTH
 
Top