I'm not sure that I follow what you are asking, but I'm gonna make an attempt at answering your question. I think you are asking how to update the records as you print them.
Technically .. you could call a UDF or method in the On Exit expression of the Detail band and update the record with code in that UDF or method call. However, I don't recommend this because there's no way to know whether the user pressed the cancel button before FoxPro finished printing.
This is how I would suggest you do this:
#1 -- In a program .. prime some variables and run the report ...
lPrinted = .f.
SELECT MyTable
REPORT FORM MyReport FOR NOT MyTable.printed TO PRINTER PROMPT
IF lPrinted
REPLACE ALL printed WITH .t. FOR NOT MyTable.printed IN MyTable
ENDIF
#2 -- Define the report
- Create a Summary Band in the report
- In the "On Exit" expression of the Summary Band, place the following expression:
_VFP.SetVar('lPrinted', .t.)
What this does is ensure that the user let the report finish printing. The Summary Band is the last thing it processes so by setting the lprinted flag in the On Exit, you can ensure that the user let the report go.
This example assumes that nobody else is updating the table at the same time you are printing. If this is a possibility in your app .. then I would suggest copying the table to a cursor and printing from the cursor. Then you can loop thru the cursor to go back and update the original table.
I hope this helps!
Cathy
>how can i 'flag' a record to a field at the same record that have we print that record?
>
>example:
>name | printeds
>---------------
>ari | 'F'
>henry| 'F'
>
>if we already print record 1 and yet record 2, so the table change into:
>name | printeds
>---------------
>ari | 'T'
>henry| 'F'
>
>if we already print record 1, so we can't print record 1, just record 2,
>after we print record 2, the table change into:
>name | printeds
>---------------
>ari | 'T'
>henry| 'T'