calculated field

T

Tom

I have a control on my form "totalmileage"
in the control source for "totalmileage", i
have "=[endmileage]-[startmileage].
It is calculating fine, however, i need to record
it to the "dispatchtable" under "totalmileage" or a
different field name.
I tried putting the calculation under default value, and assigning
control source to "totalmileage" for the table, however
the calculation does not show up, and it doesn't record
to the table.
Any help please.
TOM
 
F

fredg

I have a control on my form "totalmileage"
in the control source for "totalmileage", i
have "=[endmileage]-[startmileage].
It is calculating fine, however, i need to record
it to the "dispatchtable" under "totalmileage" or a
different field name.
I tried putting the calculation under default value, and assigning
control source to "totalmileage" for the table, however
the calculation does not show up, and it doesn't record
to the table.
Any help please.
TOM

You are using Access, a database, not Excel, a spreadsheet.

As long as you have saved the [EndMileage] and [StartMileage] data
anytime you need the result simply calculate it, as you do in your
above expression.
Do not store calculated data.
That's the proper Access method.
 
D

Duane Hookom

Do you have a good reason for storing a value that can be calculated? If so,
you would need to add some code in the after udpate event of the text boxes.
 
Top