HI all ! I have a stock control database, I want first the item sold and recorded as sold in the sale table secondly the item will be deleted from the stock table third the item wil be automatically reordered in the order table. is this possible please. I am using Dreamweaver/access and some of ASP that is generated, could you help me please. Regards.
Just run three seperate queries. Get ItemID [SELECT] Insert Item with ItemID Into Sale Table [INSERT] Remove ItemID from Stock Table [DELETE] Not sure if re-ordering an entire table is in your best interest. Maybe have a Field called SortOrder as a decimal, so you can always insert items "between" other items.
Okay, I got a gist of it, but cn.Execute("UPDATE tbl_Stock SET StockLevel = StockLevel - 1 WHERE ProductId = 123") cn.Execute("INSERT INTO tblProduct_sold (SaleId,ProductId) VALUES (321,123) ") do I have to insert all the productID ? in the script? you have also 321, second line, I assume it's saleID, then do I have to insert them all ? and again, is there any need for SQL in this case? I am a bit..if not new to asp, could you please elaborate more when you say about connection..ect, I would like to know where I could fit the script. thanks