G
Guest
I have a form "Procedures" with a subform "ProcedureItems Subform". I need
to pass the sum of the values in the subform to the parent form's table, i.e.
a bound control. The sum is stored in a control (txtTotalCost) in the footer
(control source=sum([Total Cost])).
I tried using the subform exit event, but doing so disables the form navi
buttons while in the subform.
I'm now trying to use the afterchange event in the subform, but the bound
control gets set to zero, unless I'm in debug mode. It seems txtTotalCost
doesn't have a value when the code is running outside of debug mode.
How can I pass this value successfully to my bound control?
(Yes, I know I shouldn't be setting the total cost, and this leads to data
inconsistencies. However, I need the total cost in the subform of a subform
of another form and using aggregate functions doesn't allow editability in
that subform.)
to pass the sum of the values in the subform to the parent form's table, i.e.
a bound control. The sum is stored in a control (txtTotalCost) in the footer
(control source=sum([Total Cost])).
I tried using the subform exit event, but doing so disables the form navi
buttons while in the subform.
I'm now trying to use the afterchange event in the subform, but the bound
control gets set to zero, unless I'm in debug mode. It seems txtTotalCost
doesn't have a value when the code is running outside of debug mode.
How can I pass this value successfully to my bound control?
(Yes, I know I shouldn't be setting the total cost, and this leads to data
inconsistencies. However, I need the total cost in the subform of a subform
of another form and using aggregate functions doesn't allow editability in
that subform.)