B
Bob L.
I have a subform with a calculated control in the footer that uses
sum([myfieldname]). On the main form I have a command button I use to move
to the next record. When clicked it calls a function to check the value of
the calculated text box to be sure it totals 1.0 before advancing to the
next record.
My problem is that when I open the form with data, the calculated text box
shows 100% as it should for that data. When I click the button however, the
value of the textbox is apparently empty instead of 1.0 as it should be
(confirmed this with watch variable and debug). If I click it again,
however it works fine. I can then go back and forth between records and the
check function works just fine. That is, the problem is only for the first
record after opening the form. If I watch the calculated text box I can
actually see it goes to empty as soon as I click the cmd button on the main
form.
I have tried requerying the subform, setting the focus to a text box in the
subform, etc but nothing seems to work. Any help would be greatly
appreciated.
TIA
Bob
sum([myfieldname]). On the main form I have a command button I use to move
to the next record. When clicked it calls a function to check the value of
the calculated text box to be sure it totals 1.0 before advancing to the
next record.
My problem is that when I open the form with data, the calculated text box
shows 100% as it should for that data. When I click the button however, the
value of the textbox is apparently empty instead of 1.0 as it should be
(confirmed this with watch variable and debug). If I click it again,
however it works fine. I can then go back and forth between records and the
check function works just fine. That is, the problem is only for the first
record after opening the form. If I watch the calculated text box I can
actually see it goes to empty as soon as I click the cmd button on the main
form.
I have tried requerying the subform, setting the focus to a text box in the
subform, etc but nothing seems to work. Any help would be greatly
appreciated.
TIA
Bob