|
在进行Access VBA编程的时候,写了以下代码:
'为保存物料“查询语句”字符变量赋值
STemp = "INSERT INTO 产量 "
STemp = STemp & "( ID,Date,Workshift,OrderNum,MachineID,CraftID,EmployeeID,BatchNum,MQty,"
STemp = STemp & "PQty,CBodyRQtyM,CBodyRQtyP,ModuleRQtyM,ModuleRQtyP)"
STemp = STemp & "VALUES ( '" & Me![ID] & "','" & Me![Date] & "',"
STemp = STemp & "'" & Me![Workshift] & "','" & Me![OrderNum] & "',"
STemp = STemp & "'" & Me![MachineID] & "','" & Me![CraftID] & "',"
STemp = STemp & "'" & Me![EmployeeID] & "','" & Me![BatchNum] & "',"
STemp = STemp & "'" & Me![MQty] & "','" & Me![PQty] & "',"
STemp = STemp & "'" & Me![CBodyRQtyM] & "','" & Me![CBodyRQtyP] & "',"
STemp = STemp & "'" & Me![ModuleRQtyM] & "','" & Me![ModuleRQtyP] & "')"
Debug.Print STemp
DoCmd.RunSQL STemp
运行时,系统总是报3134 INSERT INTO 语句的语法错误
请高手协助检查一下。
谢谢
附图
表结构1
表结构2
表结构
|
|