A
Andrew
This is driving me crazy.
Basically - I have a checkbox on a form that when ticked opens a
second form. Various functions are performed and values are written to
this form and into variables. From this form the variables are passed
back and used to populate additonal fields on the first form...
All except on one field/variable! This field is a sum field on the
second form. The value of this field is written to the variable and
passed back as with the others, however when reading this variable
back into a field on the first form ~ Code runs through without
breaking ~ but the actual value returned is always 0 - unless I put a
breakpoint in, and then when I run the form, it breaks at this point,
all I need do is F5 to continue running the code and !!! it returns
the expected (correct) value
On the surface it seems to be a timing issue. I've put in a simple
For/Next loop to pause but this doesn't make any difference. I also
suspected that it may be something to do with the value being
calculated on the form, and if the form hadn't been drawn on screen
yet then how could the calculation take place ~ not so, I have added
code to calculate the expected total from values held before the form
is drawn... it still returns 0 unless a breakpoint is added
Basically - I have a checkbox on a form that when ticked opens a
second form. Various functions are performed and values are written to
this form and into variables. From this form the variables are passed
back and used to populate additonal fields on the first form...
All except on one field/variable! This field is a sum field on the
second form. The value of this field is written to the variable and
passed back as with the others, however when reading this variable
back into a field on the first form ~ Code runs through without
breaking ~ but the actual value returned is always 0 - unless I put a
breakpoint in, and then when I run the form, it breaks at this point,
all I need do is F5 to continue running the code and !!! it returns
the expected (correct) value
On the surface it seems to be a timing issue. I've put in a simple
For/Next loop to pause but this doesn't make any difference. I also
suspected that it may be something to do with the value being
calculated on the form, and if the form hadn't been drawn on screen
yet then how could the calculation take place ~ not so, I have added
code to calculate the expected total from values held before the form
is drawn... it still returns 0 unless a breakpoint is added