Update field value from subform calculation

M

Meg

Hi list!

I am having difficulties getting a very simple (in
principle) idea to work.

I have a project management database, with my main form
displaying a record for each project. A subform lists the
activities associated with each project. A second subform
then lists the tasks associated with each activity linking
via a field on my main form (ie 3-level nested strucutre -
project - activity - task all with 1 to many relationships)

Each task has a field to enter expected expenditure, which
sums in the footer of the subform. I now wish to display
the total expenditure of all tasks for each activity (ie
copy the total proposed task costs up to the next highest
level - activity)

Using the After Update event of the 'tasks' subform, I can
get this to work, but only when you tab away from the
field, tab back in, then tab away again to force the
calculation. It seems that the code is just running too
fast for the calculation to occur before the update of
data.
Alternatively, I have written SQL to calculate the total,
but I dont know how to set the field value to the SQL
result.

I know there is probably really simple solution...but I
dont know what it is!!

Thanks for your help!
Meg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top