|
5#
楼主 |
发表于 2016-8-26 10:27:10
|
只看该作者
各位老师,我写了代码,
strSQL = "INSERT INTO tblStockIn_Out_Remote ( ITEM, In_Out_Date, ID_Motive, In_Out, Quantity, [Note] )"
strSQL = strSQL + " SELECT tblTemp.ITEM, tblTemp.In_Out_Date, tblTemp.ID_Motive, tblTemp.In_Out, tblTemp.RQST_QTY, tblTemp.Note"
strSQL = strSQL + " FROM tblTemp "
CurrentDb.Execute (strSQL)
strSQL = "UPDATE tblProduct_Stock_Remote INNER JOIN tblTemp ON tblProduct_Stock_Remote.ITEM = tblTemp.ITEM SET tblProduct_Stock_Remote.Real_Qty = [tblProduct_Stock_Remote]![Real_Qty]-[tblTemp]![RQST_QTY],tblProduct_Stock_Remote.Available_Qty = [tblProduct_Stock_Remote]![Available_Qty]-[tblTemp]![RQST_QTY]"
CurrentDb.Execute (strSQL)
|
|