N
Nicholas Scarpinato
I need to write a code to copy a record selected in a form. This is a little
more complicated than just copying the record, however. I need to copy it to
a second table, use a user-inputted amount as the amount in the original
record, and use the difference between the user-inputted amount and the
original amount as the amount in the copied record.
For example: The database contains a customer payment coming in from the
current check, which looks a little like this:
John Doe 4567890-0 8174561234 260.00 NEW ACTIVATION COMMISSION
However, our records show that the customer only owes $180.00. What I need
to do in that case is copy that customer information to a new table,
replacing the amount in the original record with the correct amount, and
moving the difference to the new table:
John Doe 4567890-0 8174561234 180.00 NEW ACTIVATION
COMMISSION <--- Original Record
John Doe 4567890-0 8174561234 80.00 NEW ACTIVATION COMMISSION
<--- New record in second table (also known as the overpayment table)
I'm pretty sure I know how to do the copy process, but I'm not sure how to
A) ensure that I'm pulling the correct record, and B) do the math and the
ensuing updates to the records in a fail-safe way so that it can be reversed
if necessary (i.e. the rep working on the incoming check splits a payment and
then realizes it was not necessary... I need to reverse the process and
remove that line from the overpayment table.)
Anyone who might have some insights on this, please help! Thanks!
more complicated than just copying the record, however. I need to copy it to
a second table, use a user-inputted amount as the amount in the original
record, and use the difference between the user-inputted amount and the
original amount as the amount in the copied record.
For example: The database contains a customer payment coming in from the
current check, which looks a little like this:
John Doe 4567890-0 8174561234 260.00 NEW ACTIVATION COMMISSION
However, our records show that the customer only owes $180.00. What I need
to do in that case is copy that customer information to a new table,
replacing the amount in the original record with the correct amount, and
moving the difference to the new table:
John Doe 4567890-0 8174561234 180.00 NEW ACTIVATION
COMMISSION <--- Original Record
John Doe 4567890-0 8174561234 80.00 NEW ACTIVATION COMMISSION
<--- New record in second table (also known as the overpayment table)
I'm pretty sure I know how to do the copy process, but I'm not sure how to
A) ensure that I'm pulling the correct record, and B) do the math and the
ensuing updates to the records in a fail-safe way so that it can be reversed
if necessary (i.e. the rep working on the incoming check splits a payment and
then realizes it was not necessary... I need to reverse the process and
remove that line from the overpayment table.)
Anyone who might have some insights on this, please help! Thanks!