Hi,
I've been struggling to figure this out.
I have a main form "frmClient" with a continuous subform ("sfrmMembPayments") which deals with membership payments a client makes on their annual membership.
One year a member might pay in full $50.00 then the next year the client might pay in installments.
If they pay in installments I need a remaining balance each time they make a payment.
For each payment(record) I have a field PaidInFull (yes/no)
I created a nested query in which I can calculate the remaining balance, basically it gets all payments for a specific ClientID where PaidInFull = No and sums the payments field to get a total paid. However for each payment it shows the same balance EG
Line 1 is a payment of $20 balance = $30
Line 2 is a payment of $15 balance = $15
However the balance field for both line 1 and 2 shows $15. I have been doing this using Dlookup. See image
Code Im using is as follows:
Any extra help would be greatly appreciated. Even suggestions on another approach would be helpful.
Thanks in Advance
I've been struggling to figure this out.
I have a main form "frmClient" with a continuous subform ("sfrmMembPayments") which deals with membership payments a client makes on their annual membership.
One year a member might pay in full $50.00 then the next year the client might pay in installments.
If they pay in installments I need a remaining balance each time they make a payment.
For each payment(record) I have a field PaidInFull (yes/no)
I created a nested query in which I can calculate the remaining balance, basically it gets all payments for a specific ClientID where PaidInFull = No and sums the payments field to get a total paid. However for each payment it shows the same balance EG
Line 1 is a payment of $20 balance = $30
Line 2 is a payment of $15 balance = $15
However the balance field for both line 1 and 2 shows $15. I have been doing this using Dlookup. See image
Code Im using is as follows:
Code:
Dim totalPaid As Long
totalPaid = DLookup("[Balance]", "qryMembPayBalance", "[mpClientID]=" & [mpClientID])
Me.txtBalance = 50 - totalPaid
Any extra help would be greatly appreciated. Even suggestions on another approach would be helpful.
Thanks in Advance