Group Footer Sums

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

I need to get a Group Footer Sum of each of these fields from this code.
Well actually the TxtDiscount field. The Code is in the Detail (On Format)
section of the report. It works well on giving me the totals on each
record. They are all bound fields except the TxtExt field which is a
calculated field consisting of =(CDQuantity*CDPrice). Any help appreciated.
Thanks
DS

Select Case Me.CDDiscountWhere
Case "A" 'Discount After Tax
Select Case Me.CDInclusive
Case 0 'Not Inclusive
Select Case Me.CDDiscountDP
Case 1 'Discount After Tax, Amount, Not
Me.TxtDiscount = (CDQuantity * CDDiscountAmount)
Case 2 'Discount After Tax, Percent, Not
Me.TxtDiscount = -(Me.TxtExt * 1 + CDTaxRate) *
CDDiscountPercent
End Select
Case -1 'Is Inclusive
Select Case Me.CDDiscountDP
Case 1 'Discount After Tax, Amount
Me.TxtDiscount = (CDQuantity * CDDiscountAmount)
Case 2 'Discount After Tax, Percent
Me.TxtDiscount = -(CDQuantity * CDPrice *
CDDiscountPercent)
End Select
End Select
Case "B" 'Discount Before Tax
Select Case Me.CDInclusive
Case 0 'Not Inclusive
Select Case Me.CDDiscountDP
Case 1 'Discount Before Tax, Amount, Not
Me.TxtDiscount = (CDQuantity * CDDiscountAmount)
Case 2 'Discount Before Tax, Percent, Not
Me.TxtDiscount = -(CDQuantity * CDPrice) *
CDDiscountPercent
End Select
Case -1 'Is Inclusive
Select Case Me.CDDiscountDP
Case 1 'Discount Before Tax, Amount
Me.TxtDiscount = (CDQuantity * CDDiscountAmount)
Case 2 'Discount Before Tax, Percent
Me.TxtDiscount = -Me.TxtExt / (1 + CDTaxRate) *
CDDiscountPercent
End Select
End Select
End Select
End Sub
 
How do you code a Sum() in a Group Footer (On Format) with Criteria ?

Me.TxtOne = Sum([TxtDiscount], CDDiscountWhere = "A" And CDInclusive = 0 And
CDDiscountDP = 1)

Me.TxtOne is located i the Group Footer
TxtDiscount is located in the Detail Section and is an Unbound calculated
field.
The rest are bound fields located in the Detail Section

Thanks
DS
 
How do you code a Sum() in a Group Footer (On Format) with Criteria ?

Me.TxtOne = Sum([TxtDiscount], CDDiscountWhere = "A" And CDInclusive = 0 And
CDDiscountDP = 1)

Me.TxtOne is located i the Group Footer
TxtDiscount is located in the Detail Section and is an Unbound calculated
field.
The rest are bound fields located in the Detail Section

Thanks
DS

=Sum(IIf([CDDiscountWhere]="A" and [CDInclusive] = 0 and
[CDDiscountDp]=1,[TxtDiscount],0))
 
Back
Top