Keeping currentQuantity up to date

  • Thread starter Thread starter wj8801
  • Start date Start date
W

wj8801

I have two fields currentQuantity and orderQuantity.

currentQuantity holds the current quantity for a particular item

orderQuantity holds the quantity for an order about to be taken

What I'm having trouble with is decrementing the current quantity
after an order is made I think I need to do a dynamic SQL statement
but I'm not sure how, any help would be appreciated.

Thanks



Jase
 
Jase, that approach is going to cause you grief.

If you use the AfterUpdate event of the form to exeute the SQL statement to
reduce the quantity, what happens when I realize I made a mistake and typed
100, so I go back later and change it to 10? Have you now subtracted 110
instead of 10? What if I change the entry to a different product? Do you
restore the number subtracted from the previous product? What if I delete
the entry? What if ...?

It is far better to get Access to calculate the quantity for you when you
need it. See:
Inventory Control - Quantity On Hand
at:
http://allenbrowne.com/AppInventory.html
 
Back
Top