Update for the whole application

Update for the whole application

fetch and record for update from one form to other form is fine. However, my application need to be very relative together.
For example:
Form A: a cost of something (I will call A)
Form B: fetch A * with a user input num = B
Form C: a cost of  something (I will call C)
Form D: fetch C * with a user input num = D

Form E: fetch B + fetch D = E

Fetch and Update record will work when I update value in
update Form A --> auto update to the fetching A in form B. But can not update value B
update Form C --> auto update to the fetching C in form D. But can not update value D

final, form E can not receive new fetching B and D for the amount of E unless I have to update manually form B and form D to get new B and D

How can I write script for this complicated and relative calculation?