I have a report that simply counts the number of times a field is true.

This works fine for the first group, but then falls down. The variable continues counting, how do I reset it for every group.

Here is one of the formula I am using:

Shared numberVar CountOfAwaitingOutcome;

If {tbl_Enquiry.AwaitingOutcome} = "Yes" Then
CountOfAwaitingOutcome := CountOfAwaitingOutcome + 1


The whole report is grouped by the type of procedure... So for example

There may be 3 waiting for Botox, and 1 waiting for Hip.

My reports shows

Botox 3

Hip 4

I want it to show

Botox 3

Hip 1

Can anyone help?

Many thanks

Mark