Hi all,
I am using an update query to update the stock quantity in the stock table. I know this is bad practice and calculated fields should not be stored, but I have had advice and I did try to do it the correct way but just kept running into problems.
I am using an update query behind a "Confirm" button on both a Purchase Order form and a Dispatch form. Basically the query should + or - the number in the Qty dispatched or Qty Received depending on which form is being used.
The code i am using is:
UPDATE tblStock SET tblStock.QuantityInStock = tblStock.QuantityInStock-Forms!frmDispatch!frmDispatchLine.Form.QuantityDis patched
WHERE [tblStock].[StockID]=Forms!frmDispatch!frmDispatchLine.Form.StockID;
This code does seem to work but only updates 1 row(it always seems to be the last row on the subform) no matter how many rows are in the purchase order or dispatch.
Any help would be greatly appreciated as I thought I had solved the problem a while ago, but only tested the query on 1 row until now.
Thanks
Jordan T