Hello,
Please help. I am trying to figure out how to recalculate all rows in a subform datasheet when a value in the main form is updated.
I can't post pictures yet so I will have to describe my forms.
The main form is a work order and, among other things, contains a "Quantity" field which is used in calculations in the subform.
The sub form is the routing through our various Work Centers that produce our end product. The main body of the sub form includes, among other things, a field that summarizes the rows of a datasheet within that subform and then calculates a total duration for the Work Order and a Must Start Date.
Here is the calculation I am using in each row of the datasheet.
This is triggered in the "after update" event when the Work Center is selected. "[Capacity(Lbs/Hr)]" and "Dur" are also loaded from a query when the Work Center is selected. Some Work Centers may not have a Capacity specified. In that case a Dur will be specified.
The rows in the datasheet perform a calculation of the "Duration" for each Work Center. I have all this working well and am happy with it with one exception.
I can't figure out how to cause all the rows in the datasheet to recalculate if the Quantity in the main form is updated. Any suggestions would be greatly appreciated.
Thanks,
Mike
Please help. I am trying to figure out how to recalculate all rows in a subform datasheet when a value in the main form is updated.
I can't post pictures yet so I will have to describe my forms.
The main form is a work order and, among other things, contains a "Quantity" field which is used in calculations in the subform.
The sub form is the routing through our various Work Centers that produce our end product. The main body of the sub form includes, among other things, a field that summarizes the rows of a datasheet within that subform and then calculates a total duration for the Work Order and a Must Start Date.
Here is the calculation I am using in each row of the datasheet.
Code:
If [Capacity(Lbs/Hr)] > 0 Then
[Duration] = Quantity / [Effective Capacity]
Else
[Duration] = Dur
End If
The rows in the datasheet perform a calculation of the "Duration" for each Work Center. I have all this working well and am happy with it with one exception.
I can't figure out how to cause all the rows in the datasheet to recalculate if the Quantity in the main form is updated. Any suggestions would be greatly appreciated.
Thanks,
Mike