运行以下命令时抛出上述错误:
CurrentDb.Execute "INSERT INTO Table2(FirstName, LastName)" & "VALUES('" & Me.frst_Name_txt & ", '" & Me.lst_Name_txt & "','" & "')"
谁能看到我哪里出错了?
由于
错误:
答案 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 & "')"