Apply payment to oldest recordssss

C

Chuck

A single customer has a record in a table for each
invoice. The table has the custID, invoice date, invoice
amount, last payment date and balance due.
As a result a single customer may have multiple records
with balances due.
I'd like to have a payment automatically be applied to
the open balances starting with the oldest.
At the same time the last payment date and balance due
fields would be updated.
Is the best way to open a recordset ordered by date /
desc and balance > 0 then loop thru decreasing the date
and balance on each record until the payment is fully
applied. If so does anyone have any code I can use as a
template.
Thanks
Chuck
 

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

Top