Is it possible to determine when a report printed (or print previewed) - and
maybe even who printed it? In other words, I want to run a report, and then
the next time I run it I am selecting records that changed since the last
time the report ran. Does that make sense? Any assistance is appreciated.
I'll assume you mean to save the time as well as the date the report
is run.
You could create a new table.
Table Name "tblReportRun"
Field Name "OnDate" DateTime datatype
As the first (and only record) enter the current date and time.
Then code the Open event of the report:
CurrentDb.Execute "Update tblReportRun Set tblReportRun.OnDate =
Now()", dbFailOnError
Each time you print or preview the report, the current date and time
will be entered into that field.
You could then use that field as criteria for the next report:
Either:
Select YourTable.FieldName, .... etc ... From YourTable
Where YourTable.DateField > DLookUp("[OnDate]","tblReportRun")
or...
Include the tblReportRun Table in the query.
Drag the OnDate field onto the grid along with your other fields.
Then as criteria on your DateField, write: