deducting 1 number from a total

  • Thread starter Thread starter dplove
  • Start date Start date
D

dplove

I have created a database to track software orders. Within this database I
have how many total licenses owned and how many available for deploy. I
created a checkout button that when clicked it will open another form and I
can input the info of the person that will be installing the software on
their computer.

If possible, what I would like for this to do is, when I click on the
checkout button it substract 1 from the "available for deploy" so that number
keeps decreasing each time it is installed on a computer.

If anyone has an idea of how I can make this happen or is it possible,
please let me know.

Thanks
 
You can use an event or macro to set value BUT a better way would be to have
a table that records the installation and subtract installation total from
stock level.

Something like this used for sales.
Use these three queries ---
Stock_Total ---
SELECT Stock_Table.StockName, Sum(Stock_Table.Quantity) AS SumOfQuantity
FROM Stock_Table
GROUP BY Stock_Table.StockName;

Sales_Total ---
SELECT Sales_Table_1.SalesName, Sum(Sales_Table_1.Quantity) AS SumOfQuantity
FROM Sales_Table_1
GROUP BY Sales_Table_1.SalesName;

SELECT Stock_Total.StockName,
[Stock_Total].[SumOfQuantity]-[Sales_Total].[SumOfQuantity] AS Balance
FROM Stock_Total LEFT JOIN Sales_Total ON Stock_Total.StockName =
Sales_Total.SalesName;
 
Back
Top