Update control value on parent form when all values on subform are changed to a certain value

405 views Asked by At

I am currently helping design a business case form in ACCESS 2013 for our department's product managers to facilitate them submit business cases and store data. There is one subform on the parent form, which displays all SKUs associated with the business case in datasheet view, as well as their statuses (one SKU might be in stage 1, another in stage 2), and the parent/child form are linked by case ID. That is to say one case ID is associated with many SKUs. What I want to do is to update a field value (case status) on parent form only when all SKU statues are updated to stage 3. If one SKU is stage 3 but another one is in stage 2, then don't update the case status. I googled a lot however there doesn't seem to be a solution I can find online. Could anyone please help me?

1

There are 1 answers

3
June7 On BEST ANSWER

Should not save this calculated value to table. Just calculate when needed.

A textbox on subform footer can have expression to count records where stage is not 3.

=Count(IIf(Stage<>3,1))

Textbox on main form can reference the subform textbox.

=IIf([subform container name]!tbxStageCount > 0, "Incomplete", "Complete")