B
Brook
Good Day All,
I have an invoice form that I use for orders and within that invoice form,
I have a invoicepayments subform that is set up to accept multiple payments,
assign a payment number, accept a payment amount, and deduct the amount from
the invoice total and therefore keep a running total.
I have two types of invoices, consignment (CON-0001, CON-0002, etc) and
Sold (SLD-0001, SLD-0002, etc).
What I need is to have the payments running total "reset" or calculated
for each invoice number, right now, if I enter a payment on invoice CON-0001
then go to invoice SLD-0001, the CON-0001 payment is deducted from the
invoice SLD-0001 payment total.
Thanks in advance....
Brook
Here is the code that I use on my payments form.
Private Function MyNewBalance() As Currency
Dim curInvoiceTotal As Currency
curInvoiceTotal = Me.Parent.Form![invoicetotal]
If Nz([paymentdate], 0) = 0 Then
'Set to zero to avoid triggering an error in the Dsum call
MyNewBalance = 0
Else
MyNewBalance = curInvoiceTotal - DSum("[PaymentAmount]",
"tblinvoicePayments", _
"[PaymentDate] <= #" & [paymentdate] & "#")
End If
End Function
I have an invoice form that I use for orders and within that invoice form,
I have a invoicepayments subform that is set up to accept multiple payments,
assign a payment number, accept a payment amount, and deduct the amount from
the invoice total and therefore keep a running total.
I have two types of invoices, consignment (CON-0001, CON-0002, etc) and
Sold (SLD-0001, SLD-0002, etc).
What I need is to have the payments running total "reset" or calculated
for each invoice number, right now, if I enter a payment on invoice CON-0001
then go to invoice SLD-0001, the CON-0001 payment is deducted from the
invoice SLD-0001 payment total.
Thanks in advance....
Brook
Here is the code that I use on my payments form.
Private Function MyNewBalance() As Currency
Dim curInvoiceTotal As Currency
curInvoiceTotal = Me.Parent.Form![invoicetotal]
If Nz([paymentdate], 0) = 0 Then
'Set to zero to avoid triggering an error in the Dsum call
MyNewBalance = 0
Else
MyNewBalance = curInvoiceTotal - DSum("[PaymentAmount]",
"tblinvoicePayments", _
"[PaymentDate] <= #" & [paymentdate] & "#")
End If
End Function