saving calculated fields to table

  • Thread starter Thread starter Bernie Maroney
  • Start date Start date
B

Bernie Maroney

I need to be able to save some of our calculated fields to
the table, as some of the lookup field values (such as
prices or tax rates) may change in the future, and we need
to permanently record the amount charged and paid at the
time in the database. Is the best way to use a Calculate
Total procedure using Visual Basic, called when, say, one
of the fields in the calculation is updated (AfterUpdate)?
 
Hi Bernie,

You need to ensure that the data can only be updated via a form (or a
query that you control): otherwise someone editing the table directly
could change the "input" fields but not update the calculated amount.

If you want the updated amount to appear as soon as one of the "input"
fields is entered, call the calculation in the AfterUpdate event of each
of the controls that displays these fields (and you'll need to cater for
situations where not all the values have yet been entered) .

If the value only has to be calculated when the user has finished
entering the record, do it in the form's BeforeUpdate event.

I need to be able to save some of our calculated fields to
the table, as some of the lookup field values (such as
prices or tax rates) may change in the future, and we need
to permanently record the amount charged and paid at the
time in the database. Is the best way to use a Calculate
Total procedure using Visual Basic, called when, say, one
of the fields in the calculation is updated (AfterUpdate)?

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Back
Top