Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum Caluclating on change in form 1

Status
Not open for further replies.

DarkOne72

Technical User
Jun 14, 2002
210
US
Hello,
I tried searching the forms area first for thi but can't find what I need exactly so here it goes.

I have a form that has a QTY field and Amount field; at the bottom of that field I have a sum field: =Sum([Amount]*[Order_QTY]+[BackBar_Purchases]). That is working fine but if I change the QTY it won't update the sum area with the new amount until I change records and go back or close and reopen it.
My question is, is there a way to make a change on event so if you change the QTY it will automatically update the sum field down bottom without changing records or closing it?

Thanks in advance
 
In the QTY AfterUpdate event procedure:
Me.Dirty = False

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,

Thank you for the code it worked great but I have one small problem; It shows the correct amount on the form but in the table it is just saving the original amount not multiplied by the qty any idea why?
IE.. Amount is 5.00 and QTY is 3 the form shows correctly 15.00 but in the table for that field it is only showing 5.00 in the total amount.

Thank you again
 
I have 3 fields Amount, QTY, Total Amount
Everything updates the table properly, but in the total amount field I have the formula =SUM([Amount]*[QTY]in the control source and it shows the correct Total Amount in the field on the form. however in the table there isn't anything showing at all for the total amount field.
how do you get it to show the calcualted number in the table under the total amount.

(I know i said it only showed the 5.00 in previous post but I was wrong after re-evaluating)

 
You shouldn't have a "Total Amount" field in your table but in a query doing the math.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top