Group Footer Sums

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
 
D

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
 
F

fredg

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))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

OPEN ARGS Trouble 2
Function Returns 0 3
Sub-Query Problem 8
Union Query Format 6
SQL ORDER BY 1
Argument Not Optional 3
Math Rules 14
SQL Rowsource 1

Top