how to update fileds automaticly according to entered data

J

Juliana

Hi I need help on how to do this:

I want to make database to record payment and dueday( for voice mail
service). I want to make a form to enter payment information and can update
next due day automaticly. In the form there are these fileds, "voicemailNo,
payment, date of payment and next due day", Where if the payment is $10 then
the next due day will be the day 3 months after, if the payment is $6 then
the next due day will be the day two month after. Could anyone could help me
how to create a form can update "next due day" automaticly after enter
"payment" and "day of payment"?

Thank you very much for any help.
 
W

Wayne Morgan

The main trick is how you want to do this. Do you want to keep track of both
the Date of Payment field and the Payment field and automatically adjust the
Next Due Date field if both of the previous fields were changed or do you
want to just give the user a button they can click to update the Next Due
Date field? Also, do you need the Next Due Date field if the value can
simply be calculated from the last payment date and amount? If you can just
calculate it, then you can just use a calculated control to display the date
but not store the date in the table.

The calculation to get the date is:
IIf([Payment]=6, DateAdd("m", 2, [Date of Payment], IIf([Payment]=10,
DateAdd("m", 3, [Date of Payment]))
 
Top