chrisjames25
Registered User.
- Local time
- Today, 23:05
- Joined
- Dec 1, 2014
- Messages
- 404
Hi.
WIthin a form i have a command button. As part of the code I want to update a table that is not bound to the form.
THe update qry i have tried to code states the following:
Basically when the company order say 2000 cups from a supplier, the supplier may send 500 one week and then 1500 the next. When the first 500 arrive I want to update the table to show 500 have arrived. So it would go to table, look at current amount deliverered and then add the new arrival to it. So in the example above I would initially have 0 delivered qty. THen when enter first input it would go tup to 500. THen when enter second input it would go to 2000.
THere is a reason I cant just bind this table to the form as this form is used another purpose.
I also run the code below to update when the deliveredq qty matches ordered:
And this one works fine so im just not sure why the top one doesmt.
ANy help massively appreciated.
WIthin a form i have a command button. As part of the code I want to update a table that is not bound to the form.
THe update qry i have tried to code states the following:
Code:
CurrentDb.Execute "UPDATE Tbl_SalesOrderDetails SET Delivered_Qty = delivered_qty +" & Me.Txt_QtySupplied & "WHERE SalesDetails_ID=" & Me.Txt_SalesOrderDetails_ID, dbFailOnError
Basically when the company order say 2000 cups from a supplier, the supplier may send 500 one week and then 1500 the next. When the first 500 arrive I want to update the table to show 500 have arrived. So it would go to table, look at current amount deliverered and then add the new arrival to it. So in the example above I would initially have 0 delivered qty. THen when enter first input it would go tup to 500. THen when enter second input it would go to 2000.
THere is a reason I cant just bind this table to the form as this form is used another purpose.
I also run the code below to update when the deliveredq qty matches ordered:
Code:
CurrentDb.Execute "UPDATE Tbl_SalesOrderDetails SET Delivery_Complete = True WHERE SalesDetails_ID=" & Me.Txt_SalesOrderDetails_ID, dbFailOnError
And this one works fine so im just not sure why the top one doesmt.
ANy help massively appreciated.