View Full Version : Subform calculation


dkirk02
02-26-2001, 06:48 AM
I am stumped on this one!
Situation:
Main form [Case Info] has subform [Acct Info]
In [Acct Info] I need to calculate cycle time and have it write to the table.

formula =[Date Stopped]-[Date Acct Est]
I have created a macro on the subform that is used as an after update event for the Date Stopped field using the above formula.
The procedure works on the subform itself...it even writes to the table. However, when I go into the main that uses Acct Info as the subform, when trying to perform the procedure an error comes back stating that MS can't find the form Acct Info. Can anyone help?

Rich
02-26-2001, 07:00 AM
You shouldn't store calculated values in a table use a query to retrieve cycle time.

dkirk02
02-28-2001, 05:36 AM
The end users who enter the info into the form need to be able to view the cycle time. And the cycle time will also need to be retrieved to use in reports, sometimes a month down the road. What harm will be caused by storing a calculated value in the table? I can only find documentation that states that it is not advisable, but nothing telling what will happen.
Having said all that, if you know of a way to perform my original task, could you let me know?

KevinM
02-28-2001, 06:36 AM
dirk, take Rich's advice...DO NOT store calculated fields in a table, let the query do that for you. You can always base your forms and reports on the query and display the calculations there.