robsworld78
Registered User.
- Local time
- Today, 04:45
- Joined
- May 31, 2011
- Messages
- 99
Hi, I'm trying to get an SQL update to work with 2 criteria's however I can only get one of them working at any given time, any ideas?
This code works fine and finds the correct product.
This code works fine and finds the correct order.
This code doesn't work, no matter which order I put the criteria's it says "Compile Error: Variable not defined" I've tried many combinations with commas etc but can't get it working.
This code works fine and finds the correct product.
Code:
DoCmd.RunSQL "UPDATE Inventory SET BarsGiven=" & Forms!CreateOrders!CreateOrdersVansSetForTransfer.Form!BarsLeft & _
" WHERE Product = " & Forms!CreateOrders!CreateOrdersVansSetForTransfer.Form!ProductID
Code:
DoCmd.RunSQL "UPDATE Inventory SET BarsGiven=" & Forms!CreateOrders!CreateOrdersVansSetForTransfer.Form!BarsLeft & _
" WHERE OrderID = " & Forms!CreateOrders!OrdersOrdersSubform.Form!OrderID
Code:
DoCmd.RunSQL "UPDATE Inventory SET BarsGiven=" & Forms!CreateOrders!CreateOrdersVansSetForTransfer.Form!BarsLeft & _
" WHERE Product = " & Forms!CreateOrders!CreateOrdersVansSetForTransfer.Form!ProductID AND OrderID = " & Forms!CreateOrders!OrdersOrdersSubform.Form!OrderID"