Calculating fields within a Record

chuckster

Registered User.
Local time
Today, 22:28
Joined
Oct 4, 2000
Messages
52
I want to calculate a field based on the values of others fields in the same record.
I have put an equation in the control source property which generates the correct result but this doesn't write the result into the table that the form is linked to.
 
if you want to do this, you'll need to do an update query on the table, but if you can calculate a value on the fly from data in your table, it's usually best to do just that and not to store it.

Mike
 
Cheers. Makes sense.
 
Hope this helps. It let me do a calculation for a field and have the value saved in the table, without using a separate update query on the whole table.

On data entry form, I made the field that I want to store info (ie, AGE_AT_APPLICATION, invisible. Then I added an unbound text box (ie, AGE_CALCULATION) which had as Control Source the calculation itself.

On each field involved in doing the calculation I added an AfterUpdate code of: Me.AGE_AT_APPLICATION = Me.AGE_CALCULATION

IT then shows the age automatically in the form's AGE_CALCULATION field and automatically stores the age in the AGE_AT_APPLICATION field in the table.

Hope this helps.
 

Users who are viewing this thread

Back
Top Bottom