Crystal Reports subtotalling with variables

SOLVED

Crystal Reports 2016 Support Pack 2

I am using variables to do subtotals of values carried forward from a subreport.  I have set up the following formulas:

Initiation formula:

BDG START  - whileprintingrecords; currencyvar bdgfrpd; bdgfrpd := 0
FASSOU START  - whileprintingrecords; currencyvar FASSOUFRPD; FASSOUFRPD := 0

These have been put into the Group Header section and are suppressed.

Subtotaling formula:

BDG ST -  whileprintingrecords; currencyvar BDGFRPD; BDGFRPD := BDGFRPD + {@Sales BDG Paid Freight}
FASSOU ST -  whileprintingrecords; currencyvar FASSOUFRPD; FASSOUFRPD := FASSOUFRPD + {@Sales Fassou Paid Freight}

These have been put into the Detail section and are suppressed.

Display of the subtotal formula:

BDG ST DISP  -  whileprintingrecords; currencyvar BDGFRPD; BDGFRPD
FASSOU ST DISP -  whileprintingrecords; currencyvar FASSOUFRPD; FASSOUFRPD

These have been put into the Group Footer section and are NOT suppressed.

The subtotals being produced are not correct.  In some cases, the last detail lines's value within the group is being added in twice.  In other cases, the subtotal is correct but the other subtotal is including the value from the other subtotal.

I also have formulas to product a grand total set up similarly to these formula for subtotaling and the grand total formula are working fine.