|
以下代码运行是正常的,import_tempTalbeA为表,stID以及g_CurrentUserID为定义的函数,用于记录变量数据的,请问如何可以在上述插入语句后,再将StID及g_CurrentUserID的值加入到import_tempTableA中!使得import_temTableA在插入数据后基础上再增加栏位“入库单ID”及“操作员”的值。
(表.import_temTableA 已有字段"入库单ID,事务号, 采购单ID, 行号, 物料编号, 单价, 数量, 单位, 入库日期, 入单日期, 总价,操作员")
DoCmd.RunSQL "INSERT INTO import_tmpTableA ( 事务号, 采购单ID, 行号, 物料编号, 单价, 数量, 单位, 入库日期, 入单日期, 总价) SELECT QAD_TR_HIST.TR_TRNBR, QAD_TR_HIST.TR_NBR, QAD_TR_HIST.TR_LINE, QAD_TR_HIST.TR_PART, QAD_TR_HIST.TR_PRICE, QAD_TR_HIST.TR_QTY_LOC, QAD_TR_HIST.TR_UM, QAD_TR_HIST.TR_EFFDATE, QAD_TR_HIST.TR_DATE, (QAD_TR_HIST.TR_PRICE * QAD_TR_HIST.TR_QTY_LOC) FROM QAD_TR_HIST WHERE (((QAD_TR_HIST.TR_EFFDATE) Between [forms]![数据导入]![sdata] And [forms]![数据导入]![edata]) AND ((QAD_TR_HIST.TR_TYPE)='RCT-PO') AND ((QAD_TR_HIST.TR_LOC)='Mainten') AND ((QAD_TR_HIST.TR_DOMAIN)='GD')) ORDER BY QAD_TR_HIST.TR_EFFDATE DESC" |
|