Re: Running total in a form...
From: Allen Browne (AllenBrowne_at_SeeSig.Invalid)
Date: 12/16/04
- Next message: agarwalp_at_eeism.com: "disable mouse scroll in subform"
- Previous message: Dave Bradshaw: "Re: Barcodes"
- In reply to: Gettingthere: "Running total in a form..."
- Next in thread: Gettingthere: "Re: Running total in a form..."
- Reply: Gettingthere: "Re: Running total in a form..."
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 16 Dec 2004 16:57:58 +0800
The amount paid in *other* lines of the trasaction is:
=DSum("Amt_Paid", "TransTable",
"([Trans_ID] = " & Nz(Me.[Trans_ID], 0) &
") AND ([Inv_Nr <> " & Nz(Me.[Inv_Nr], 0) & ")")
So the balance left is:
=[Inv_Amt] - [Amt-Paid] - DSum("Amt_Paid", "TransTable", "([Trans_ID] = " &
Nz(Me.[Trans_ID], 0) & ") AND ([Inv_Nr <> " & Nz(Me.[Inv_Nr], 0) & ")")
I would suggest that you do not store the Inv_Amt at all. You may want to
use an unbound text box so the user can enter it and the interface can help
them, but it should not be stored in the payment table.
-- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Gettingthere" <Gettingthere@discussions.microsoft.com> wrote in message news:9219874F-F5C5-4274-9AB7-6212CF1293FE@microsoft.com... >I have a form Tbl_trans. In this form you enter the Inv_Nr , Inv_amt, > payment_type, Amt_Paid and Paid_with. Now I have created a form to enter > the > data,. > The problem I have is that there may be several invoices paid with 1 > transaction, eg: 1 credit card payment maybe be linked to 3 different > invoices. The data entry operator needs a box on the data entry form the > tell them the balance left on that credit card payment. Eg: Inv1 = $25 > but > the payment is $75, Inv2 has a value of $25.00 and is paid with Inv1, > Inv3 > has a value of $25 and is paid with inv1, therefore the balance of the > credit > card transaction starts at (75-25) $50, then as the second inv is > entered > $25 and the third $0. > I have created a query which when run will give me a balance grouped by > the > Paid_with field, works somewhat, but I cannot get it to dynamically update > in > the trans_form (query as a subform) when we enter the data. I think is > either an requery or after update problem > > Unsure, I have tried a few thing but nothing works, maybe am going about > it > the wrong way. > > Any Help appreciated > > Thanks > > Roger
- Next message: agarwalp_at_eeism.com: "disable mouse scroll in subform"
- Previous message: Dave Bradshaw: "Re: Barcodes"
- In reply to: Gettingthere: "Running total in a form..."
- Next in thread: Gettingthere: "Re: Running total in a form..."
- Reply: Gettingthere: "Re: Running total in a form..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|