DoCmd.RunSQL ("UPDATE products SET products.Stock =(products.Stock -1 WHERE products.ProductID=17") that works fine.
Code below Don't Work.
-----------------don't work-----------------------
DoCmd.RunSQL ("UPDATE products SET products.Stock = (products.Stock - [Forms]![Orders]![Order Details Subform]![Quantity] WHERE products.ProductID=[Forms]![Orders]![Order Details Subform]![productid]")
this is my sql query. it will work perfectly if I manually put data in the varibles but If I reference the form data it doen's work. if I msgbox out the form data it shows fine. but once I put the form variable back in the sql stings they are blank. how can I get the value of the form data in the sql string.
Code below Don't Work.
-----------------don't work-----------------------
DoCmd.RunSQL ("UPDATE products SET products.Stock = (products.Stock - [Forms]![Orders]![Order Details Subform]![Quantity] WHERE products.ProductID=[Forms]![Orders]![Order Details Subform]![productid]")
this is my sql query. it will work perfectly if I manually put data in the varibles but If I reference the form data it doen's work. if I msgbox out the form data it shows fine. but once I put the form variable back in the sql stings they are blank. how can I get the value of the form data in the sql string.