hokiewalrus
Registered User.
- Local time
- Today, 06:39
- Joined
- Jan 19, 2009
- Messages
- 50
It's likely that there is something simple that I am missing, but I have been banging my head against the table all day with this:
I have a form that needs to calculate the total based on the changed values in a subform. The subform changes and recalculates correctly, however the text box on the main form is always "1 step behind". Put it another way, it appears that all of the code in the _afterupdate function is being executed before the table the subform is based on is being changed, so the total is always being calculated from out-of-date information.
Currently I'm calculating the total with a function call in the last line of the _afterupdate procedure and it's the closest I've been able to come, I can't get DSum or anything else to give me anything but an error.
Unfortunately, I can't just set the control source for the text box as the user has to be able to click in that box and override the given total if they want to.
Hopefully there is something stupid I am missing due to my inexperience.
I have a form that needs to calculate the total based on the changed values in a subform. The subform changes and recalculates correctly, however the text box on the main form is always "1 step behind". Put it another way, it appears that all of the code in the _afterupdate function is being executed before the table the subform is based on is being changed, so the total is always being calculated from out-of-date information.
Currently I'm calculating the total with a function call in the last line of the _afterupdate procedure and it's the closest I've been able to come, I can't get DSum or anything else to give me anything but an error.
Unfortunately, I can't just set the control source for the text box as the user has to be able to click in that box and override the given total if they want to.
Hopefully there is something stupid I am missing due to my inexperience.