Modify some fields after close

Hi,

I would like to modify and save 2 fields (and only them) just after the doc has been closed (or during the query close or terminate event.

Any idea ?

thanks for your help

luc