A Requery Timing problem

A

Al Camp

I have two subforms (form Sub1 and continuous Sub2) on one main form.
There is a Qty field on Sub1 that uses a Sum value (TotalOnHand) from the
footer of Sub2 to make a certain decision.

I have a [+] button that increments the Qty field on Sub1 by 1 each time,
and
each time I increment the Qty, I check the TotalOnHand to determine if I've
met a certain criteria for TotalOnHand. After this criteria checking, I
requery Sub2 to reflect the newly incremented Sub1 Qty.

This works fine, but, if I re-click the [+] button too quickly, I can
outpace the Sub2 Requery, and receive erroneous messages pertaining to the
TotalOnHand "criteria" logic. (thinks TotalOnHand = 0)
Sequence:
User Clicks [+] = (Qty +1)
Check the TotalOnHand criteria against TotalOnHand - Qty
Requery Sub2
User Clicks [+] = (Qty +1) (where the problem arises, requery not
complete)

(I've tried disabling the [+] button, during the requery, and
re-enabling afterwards, but it too allows the [+] to enable too soon)

Is there a method or technique to force Access to complete the
requery, before allowing another [+] Click?

Thanks in advance,
Al Camp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top