Pat Hartman said:
Why can't you use a Sum() in the footer?...
My continuous subform Payments displays a TotalDue after (for) each record (payment for a class registration). However, some of the payments are partial payments for the same RegistrationID. In such case my TotalDue displays the same total amount due for a given RegistrationID whenever the payment for that RegistrationID appears.
Now, my SUM in the footer must display AccountBalance which in this case cannot be the SUM of TotalDues because of all the partial paymants that must be grouped first
To give a simplified visual of what my subform displays:
PaymentID | amount | RegistrationID | TotalDue
001 | $100 | 23 | -$100
002 | $200 | 01 | -$75
003 | $400 | 23 | -$100
*RegistrationID links to Classes and their Fees, so in case of RegistrationID=23 fee for that class is $600. Total payments for "Class23" are $500 ($100+$400). So balance on each row displays due for that class as $100 (600-500). So now the TOTAL ACCOUNT BALANCE is not SUM of TotalDues (-$275) but: -$175.
What I'm trying to show on that subform somewhere is the TOTAL ACCOUNT BALANCE of -175 calculated based on the query I designed (which groups all the payments and calculates the sum for each forms!frmMain.recordID). My question is how to set the value of that control TOTAL ACCOUNT BALANCE to what the query calculates for me and on what event since I want it to update whenever the subform gets requeried or/and when its records get updated.
Thanks for your help guys,
M