perform calculations in access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,

I'm performing a date calculation =[TDT_Doc_Out_Date]-[TDT_Doc_In_Date] to
return a number to a field on a form. The calc works fine, but I can't get
the number to update to the underlying table for reporting purposes.

Thanks
 
Daisy,

You are already using the control's Control Source property for
performing the calculation, I understand; this is one use for this
property, the other one is to bind it to a table field (which would
result in the value being stored in the table), but I'm afraid you can't
do both! It's gotta be one or the other.

There are ways around this, by means of using an alternative method
(macro or code) for either (a) the calculation or, (b) getting the
value stored in the table; the latter would normally be less convenient.

Yet, answer to your question is, do not store the calculated value at
all! If you can calculate it in a form, you can also calculate it in a
report (or the query from which the report gets its data), so no need to
store, and no need to maintain if one of the two input fields changes.
Not storing saves you both the trouble and the grief of compromised data
integrity.

HTH,
Nikos
 
daisy said:
Hi there,

I'm performing a date calculation =[TDT_Doc_Out_Date]-[TDT_Doc_In_Date] to
return a number to a field on a form. The calc works fine, but I can't get
the number to update to the underlying table for reporting purposes.

Why would you want to? Just perform the calc in a query whenever it's
needed. :-)

Regards,
Keith.
www.keithwilby.com
 
Back
Top