>Erik,
>Thanks. But I have tried to do exactly that and never got it to work (VFP6.0).
>What I did is:
>- define xx as a report variable in a report that uses data grouping
>- in the on exit run expression for my group I put xx=xx+1
>- in the detail band, I show the value of xx
>
>And, no matter what I do, it is always 0. The report is long, and the "on exit" must have run hundreds of times.
>
>I tried the same with the on exit in page footer, in a multiple page report, with same result.
>
>Please throw in some light....I need it!
I'm sorry, I answered too quickly. The epxression that you put in the On entry is evaluated, not executed, so
x=x+1 in this field will do the same as typing
?x=x+1 in the command window: it will return .F. because x does not equal x+1.
But don't fret- you can run however much code you need to in a UDF- incrementing a counter or whatever.
But for a simple counter, you don't need to do this- you can instead, double click the report field, and then click "Calculations", and select "Count" from the button group. This creates a field that counts the number of records aggregated in the group.
HTH, and sorry for misleading you.
Erik Moore
Clientelligence