Calculation in footer of sub form lag. (1 Viewer)

HairyArse

Registered User.
Local time
Today, 22:59
Joined
Mar 31, 2005
Messages
92
Hi guys.

I have an orders form with a subform containing each item on the order.
An item has a price and a quantity.
On the footer of the subform is a field called txt_order_total which calculates sum([quantity]*[price]).

On the main form is a unbound text control that displays the order total as well as a hidden form containing the customer's credit limit.

I am trying to check that the order total does not exceed the customer's credit limit and am trying to run this check on the main form's onCurrent event.

However, this isn't working because there's a lag between when the form/record opens/is loaded and the calculation is completed. It takes a good 1-2 seconds for the calculated total to appear, and so running my check onCurrent performs its action before the calculation has finished.

Is there another way to do this or is there another onEvent I should be using?
 

missinglinq

AWF VIP
Local time
Today, 17:59
Joined
Jun 20, 2003
Messages
6,423
To be honest, I'm a little fuzzy as to how you're attempting to do this, especially the part about the 'hidden form' with the credit limit. The approach that I'd take would be to use the DLookup() function to return the customer's credit limit, and I'd probably do it on the Sunform footer where the order total is being calculated, rather than on the Main Form.

Linq ;0)>
 

HairyArse

Registered User.
Local time
Today, 22:59
Joined
Mar 31, 2005
Messages
92
Sorry, I didn't mean hidden form I meant hidden control.

So on the main form are two text boxes. One containing the credit limit, one containing the order total. But the order total takes 1-2 seconds to appear and kicks in long after the OnCurrent event has had time to fire.
 
Last edited:

Users who are viewing this thread

Top Bottom