Calculated values fed to tables

  • Thread starter Thread starter John Hipskind
  • Start date Start date
J

John Hipskind

I realize that calculated values should not normally be
fed to table fields, therefore this is not a standard
Access feature. However, I have a situation where I would
like to do just that.

Example:
A contractor has 100 days to finish a project. After 50
days, he is 50% complete. Subsequently, he is given an
extra 10 days to complete the project, for a total of 110
days. After 75 days, he is not 75% complete, but rather
75/110=68% complete.
I do not want to change the previous records, before the
extra time was allowed.

The % completion should be a unique field value in a
unique record, yet calculated from other data.

Is there a simple way to do this? (I could just do my own
calculation, then enter it in the form's field to send it
directly to the table, but I'd rather see if I can get
Access to do it for me.)

(To Dirk G.: thanks for your previous response. My reply
button doesn't always work, or I would have asked you
this.)

Thanks for your help.

John
 
Is there a simple way to do this?

Well, not trivial but not too hard. I'd suggest using the Form's
BeforeUpdate event to do the calculation and "push" the calculated
value into the table field. It may be useful to have *two* textboxes
on the form, one with the calculated expression as its control source,
and the other bound to the table field (perhaps invisible); in the
Form's BeforeUpdate just set the value of the bound control to that of
the calculated control:

Me!txtBoundControl = Me!txtCalculatedControl
 
Back
Top