I want to count the number of lines printed in the details setion of a group, not the total number - I have certain lines suppressed.

I have a section suppressed if a=b and c=d
So I have tried creating a count in the details section

whileprintingrecords;
NumberVar RecCount;
if a=b AND c=d then
RecCount := RecCount+1

I am also resetting this variable to zero in the group header, but it just doesn't seem to be holding a count??????