Order and UnitsInStock

  • Thread starter Thread starter Syphonics
  • Start date Start date
S

Syphonics

hi guys
I am new with ms access, lately i am tasked to come out a progrm for my
company using access.
I am stuck at this problem.
When the Quantity of the product is key in, i need the value in UnitsInStock
to be subtracted acording to the Quantity field in the order form.

Thank you.
 
There's a bit more to it than just subtracting the value.

For example, imagine the user entered 60 widgets, and you subracted 60 from
the UnitsInStock in your table. Now the user says, "Oops: that should have
been 6." When they change the record, do you restore the other 54?

Or, they say, "Oops; it wasn't 6 widgets, it was 6 foobars." Now does your
code restore the 6 wigets, and subtract 6 foobars instead?

Or, they realize they made a mistake, and delete the row. Do you catch the
delete and restore the quantity to the right product?

What if they select several rows at once and delete? Do you cope with that?
Or perhaps there is a cascading delete between the main order and the row
items?

And if you miss anything *once*, the stored value will always be wrong from
then on? So your database gradually gets more and more wrong over time?

A better solution might be to ask Access to calculate the quantity when
needed instead of trying to handle all those cases. For details, see:
Inventory Control - Quantity On Hand
at:
http://allenbrowne.com/AppInventory.html
 
Back
Top