Page 1 of 1

[Solved] Make Form Entries Update Inventory Quantities

PostPosted: Sun Feb 24, 2013 5:25 am
by AGoodwin
I am working on a database that one of the functions will be to keep track of inventory of a few products of various sizes. I have a form set to enter when new products are added, but I am unsure of how to go about it so that when a new entry is created, a field showing the current qty is updated. I will also need to be able this total be deducted with another form that will track usage of the items. I would think that just simply linking the fields would cause the previous entries to be replaced, rather than added to. So, how do I go about creating this effect?

ex.

addition entry 1: Product A, Size 1, QTY 10
addition entry 2: Product B, Size 3, QTY 20
addition entry 3: Product A, Size 1, QTY 25
addition entry 4: Product A, Size 2, QTY 50

Should cause the QTY fields to show:

Product A, Size 1, QTY 25
Product B, Size 3, QTY 20
Product A, Size 2, QTY 50

Then when I had the following usage entries...

Product A, Size 1, QTY 1
Product B, Size 3, QTY 2
Product A, Size 2, QTY 5

It should cause the QTY fields to show:

Product A, Size 1, QTY 24
Product B, Size 3, QTY 19
Product A, Size 2, QTY 45

Re: How to Make Form Entries Update Inventory Quantities

PostPosted: Sun Feb 24, 2013 9:56 am
by Villeroy
Record all input and output.
Calculate the inventory.
Example: download/file.php?id=14074
With time stamps for the inputs and outputs you may even calculate the inventory at any time in the past.

Re: How to Make Form Entries Update Inventory Quantities

PostPosted: Tue Feb 26, 2013 6:47 am
by AGoodwin
Thank you. Your solution works great and is so simple.