Hello all,
I am simply trying to reduce the quantity in stock by the number ordered.
I am a newbie to VBScript so any and all help is appreciated.Code:set rsUpdateQuantity = Server.CreateObject("ADODB.Recordset") rsUpdateQuantity.Open "SELECT * FROM products WHERE productNumber = " _ & intStock, Conn, adOpenStatic, adLockOptimistic, _ adCmdText if rsUpdateQuantity("numInStock") > 1 then intNumInStock = rsUpdateQuantity("numInStock") if intQuant < intNumInStock then rsUpdateQuantity("numInStock") = intNumInStock - intQuant end if else rsUpdateQuantity.DELETE end if rsUpdateQuantity.Update rsUpdateQuantity.Close




Reply With Quote