On Oct 29, 4:39 pm, Toby Gallier <azr...@gmail.c omwrote:
I am trying to figure out a way to update multiple records when a
report is exported. Each record has a "Status" field. I have a query
that selects all records with a status of "To Send" and that feeds
into a report. When the report is exported i want the status to be
changed from "To Send" to "Sent".
Any help would be appreciated.
Thanks!
It can't actually know that the report printed or exported... it only
knows that the attempt was made. If you are using a command button to
export the report, then add a line after the line that generates the
report, that updates the table.
Here is an example:
dim db as dao.database
dim sSQL_WHERE as string
set db = currentdb( )
sSQL_WHERE = " [FieldOne]=" & num1 & " [FieldTwo]=TRUE"
db.execute "UPDATE tblSomeTable SET [Printed] = TRUE WHERE " &
sSQL_WHERE
sSQL_WHERE must be set to the WHERE portion of the same query that the
report is based on with the same parameters.