I need to handle the stock on hand for each purchase made. 1 purchase can have muitlple products with each product have diferent qty. Currently I have a stock table that keep the stock on hand, in my order form after update of each qty field I do a subtraction from the stock table via mysql.
DoCmd.RunSQL "UPDATE products SET Stock=Stock - " & Forms!Orders![Order Details Subform].Form!Quantity & " WHERE ProductID=" & Forms!Orders![Order Details Subform].Form!ProductID
the problem I have with this is that I need to do a insert for each product ordered, currently its only doing it for the last product. Is there a better way to handle stock? if so can someone please point me to an example where they are checks and balances for the quantity sold/remain
DoCmd.RunSQL "UPDATE products SET Stock=Stock - " & Forms!Orders![Order Details Subform].Form!Quantity & " WHERE ProductID=" & Forms!Orders![Order Details Subform].Form!ProductID
the problem I have with this is that I need to do a insert for each product ordered, currently its only doing it for the last product. Is there a better way to handle stock? if so can someone please point me to an example where they are checks and balances for the quantity sold/remain