错误' 3075'语法错误(缺少运算符)访问2013

时间:2014-04-26 10:33:29

标签: database ms-access

运行以下命令时抛出上述错误:

CurrentDb.Execute "INSERT INTO Table2(FirstName, LastName)" & "VALUES('" & Me.frst_Name_txt & ", '" & Me.lst_Name_txt & "','" & "')"

谁能看到我哪里出错了?

由于

错误:

enter image description here

2 个答案:

答案 0 :(得分:2)

您有额外的值'" & "',并且Text数据类型需要围绕值的分隔符。最简单的撇号。

试试这个

CurrentDb.Execute "INSERT INTO Table2(FirstName, LastName)" & "VALUES('" & Me.frst_Name_txt & "','" & Me.lst_Name_txt & "')"

答案 1 :(得分:1)

你错过了撇号:
CurrentDb.Execute "INSERT INTO Table2(FirstName, LastName) VALUES('" & Me.frst_Name_txt & "', '" & Me.lst_Name_txt & "')"