Re: Halt code execution until requery is finished.

Tech-Archive recommends: Fix windows errors by optimizing your registry



Al Camp wrote:

Is there some code, or technique that I can use that will force a subform
requery to finish completely, before subsequent code runs?

Sequence of code (aircode)
First button click = increment a qty by +1
Make a decision about (qty +1)
Requery subform to reflect new qty

Second Button click = increment a qty by +1
**Make a decision about (qty + 1) (**Problem: the subform has not finished
the requery,
so my decision coding returns erroneous values from the requeried subform.)

Tried disabling/enabling the button, but it enables the button before the
Requery is complete.


You can do a MoveLast on the subform's RecordsetClone to
force the subform's record source to completely load.
However, that may not force all controls on the subform to
complete their recalculation. So a total using an aggregate
function may still be out of sync.

--
Marsh
MVP [MS Access]
.


Quantcast