How to tell if a legacy control changed
I am creating a Promissory Note form using legacy controls so I can calculate monthing payments based on loan origination, first payment date, final payment date and rate.
I initialize these fields in the Document_New sub.
The monthly payment is calulated when a loan/note amount is entered.
All this is working fine
I would like to recalulate if any of the dates change with the Exit macro:
loan origination:
If > first payment, then adjust first payment date to the beginning of the next
month and adjustthe final payment date for number of periods. (monthly payment
is not changed since Loan Amoritization just shifts left/later)
first payment date:
If changed, recalulate final payment date (again monthly payment is not affected)
final payment date:
If changed, recalculate number of payment periods, and recalculate monthly
payments.
I am trying to find a way to tell if the dates changed when leaving the field.
I tried global declarations of values, but found out lifetime of these variables is only valid while a sub/function is active.
I am looking at static variables to save previous values. Is there a better way?
Thanks,
Ken
|