copy field values

  • Thread starter Thread starter Lez
  • Start date Start date
L

Lez

I have a control field with a derived value in it, I want to add this value
to a field in my table and have tried adding the following vba code on the
onCurrent event

Me.Ctl3yrlease_rate = Me.txt3yrrate

The value is not being captured,anything anyone can suggest

Thanks
 
If by derived value you mean a calculated value based on the values in other
fields, the thing I would suggest is that you not store the value. It is far
better to re-create it on the fly when it is needed. Having said that, the
place to call for a calculation to be performed is probably in something like
the After Update event for the controls that contribute values to the
calculation when you are entering or working on a record. The form's On
Current event would work for viewing existing records, but that event runs
once when you go to another record, so would not work for calculations when
you change data in the current record.
Again, I urge you not to store the calculated value. You're going to
perform the calculations anyhow each time you go to the record in a form.
Leave it at that. Anything more is redundant.
 
Back
Top