storing values of a calculated field

sush

Registered User.
Local time
Today, 17:57
Joined
Feb 8, 2000
Messages
29
How can i store down values of a caluclated field.??

ie Start time
finish time

Hours/Mins = <Calculated Fields> - needs to be stored

Rate:

Line Total <[Hours/Mins]*[Rate]> - needs to be stored down?

Any ideas

Thank you
 
Generally you don't store calculated fields. ID is that you can do the calculation anytime you need the data. But if you must store them you need to Bind the field to a table (Control Source Property). I find the easiest solution is to add code on the afterupdate of the fields that are used to get the calculation to set the field for the answer:

Private Sub Rate_AfterUpdate()
Me.[Total] = me.[Hours/Mins]*[Rate]
End sub

Private Sub Start_Time_AfterUpdate()
Me.[Hours/Mins]= DateDiff("n",[Start Time],[Finish Time])
me.[Total] = me.[Hours/Mins]*[Rate]
end sub

hope this helps
 

Users who are viewing this thread

Back
Top Bottom