Hello all. Please help me.

I have a crystal report.
I want to execute an Update query when the reports are printed.
In one of the tables that are a source for the report, i have field called "print_flag".
When anyone prints a document then i want to change that flag from "N" to "y".
Please help with this!!

From searching on web i found that there is a
"whileprintingrecords" function that we can use. But I dont know how to use an SQL stmt with it
I put the sql stmt in double inverted commas after the function but it did not work.

Please help..