Variable/Field value not being held
From: Chris (anonymous_at_discussions.microsoft.com)
Date: 04/14/04
- Next message: Mike P: "Passing Parameter from a Form to a Query"
- Previous message: fredg: "Re: Displaying a long form"
- In reply to: Andrew: "Variable/Field value not being held"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 13 Apr 2004 18:34:01 -0700
A for-next loop is not the equivalent of a pause. Sure it
wastes time, but it's busy. Try a DoEvents statement. Or
two.
>-----Original Message-----
>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
>.
>
- Next message: Mike P: "Passing Parameter from a Form to a Query"
- Previous message: fredg: "Re: Displaying a long form"
- In reply to: Andrew: "Variable/Field value not being held"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|