>Not knowing what's a greenbar (I imagine it as a salad bar :) I can only suggest a separate function and a separate variable for each band, or the same function with different parameters, so it would check for the recno() in the detail, and the group expression in group bands.
Dragan,
I tried the same function with different parameters for each band, but I had inconsitant results. That is why I started tracking where the calls were coming from with a Wait Window in my function.
FYI, the greenbar effect is kind of a throwback to the old computer paper which had alternating green and white bars. It can be very helpful when you are looking at many rows on a printed report. You can simulate this effect with a shaded rectangle on the report.
Kind Regards,
Mat