Disclaimer: I've already come up with a solution for this issue, but I thought I'd post it in the hope that it could help someone else and on the off chance that someone has another solution.
I have a form for machine operator tracking. The form shows training-stage tracking dates with a lot of performance information. On the form is a subform for reviews, which uses a set of unbound text boxes to show current data for a review, which is unsaved until the supervisor adds comments and clicks a "submit" button, which then adds the data (with comments) to a reviews table.
The unbound text boxes each have an IIf statement as the default value, which references values on the parent form. However, if the required stage tracking review has already been completed, code in the On Open event runs to calculate the performance data from the last review to the most current data for the machine operator. This new data is displayed in the unbound text boxes.
Everything worked fine, with all of this new data properly displayed, until the supervisor went to print the form. When the form printed, all of the default values printed out, even thouth the new data was still on-screen.
First, I tried removing the default values and assigning values for each textbox in code: this was a fiasco. Suddenly, nothing at all showed up, in form view or on the printout. So, I tried assigning default values in code: again, nada. Then I got creative - I put the old default values back on the textboxes, then used the code only to change the default value to the new values if necessary. Amazingly, this worked, and the best part is that this default value only remains default while the form is open, since the change wasn't made in design view but in form view.
Has anyone else run into this? Anyone have a better solution?
I have a form for machine operator tracking. The form shows training-stage tracking dates with a lot of performance information. On the form is a subform for reviews, which uses a set of unbound text boxes to show current data for a review, which is unsaved until the supervisor adds comments and clicks a "submit" button, which then adds the data (with comments) to a reviews table.
The unbound text boxes each have an IIf statement as the default value, which references values on the parent form. However, if the required stage tracking review has already been completed, code in the On Open event runs to calculate the performance data from the last review to the most current data for the machine operator. This new data is displayed in the unbound text boxes.
Everything worked fine, with all of this new data properly displayed, until the supervisor went to print the form. When the form printed, all of the default values printed out, even thouth the new data was still on-screen.
First, I tried removing the default values and assigning values for each textbox in code: this was a fiasco. Suddenly, nothing at all showed up, in form view or on the printout. So, I tried assigning default values in code: again, nada. Then I got creative - I put the old default values back on the textboxes, then used the code only to change the default value to the new values if necessary. Amazingly, this worked, and the best part is that this default value only remains default while the form is open, since the change wasn't made in design view but in form view.
Has anyone else run into this? Anyone have a better solution?
Comment