The above error is being thrown when I run the below command:
当我运行下面的命令时,上面的错误被抛出:
CurrentDb.Execute "INSERT INTO Table2(FirstName, LastName)" & "VALUES('" & Me.frst_Name_txt & ", '" & Me.lst_Name_txt & "','" & "')"
Can anyone see where I am going wrong?
有人能看出我哪里做错了吗?
Thanks
谢谢
The error:
错误:
2 个解决方案
#1
1
You have extra value '" & "'
and also Text data types require delimiters around the value. At its simplest an apostrophe.
您有额外的值“&”,并且文本数据类型需要围绕值进行分隔。最简单的是撇号。
Try this
试试这个
CurrentDb.Execute "INSERT INTO Table2(FirstName, LastName)" & "VALUES('" & Me.frst_Name_txt & "','" & Me.lst_Name_txt & "')"
#2
1
You're missing an apostrophe: CurrentDb.Execute "INSERT INTO Table2(FirstName, LastName) VALUES('" & Me.frst_Name_txt & "', '" & Me.lst_Name_txt & "')"
您缺少一个撇号:CurrentDb。执行“插入到表2(FirstName, LastName)值(' ' ' & Me. frst_name_txt和' ',' '和Me)中”。lst_Name_txt &”)”
#1
1
You have extra value '" & "'
and also Text data types require delimiters around the value. At its simplest an apostrophe.
您有额外的值“&”,并且文本数据类型需要围绕值进行分隔。最简单的是撇号。
Try this
试试这个
CurrentDb.Execute "INSERT INTO Table2(FirstName, LastName)" & "VALUES('" & Me.frst_Name_txt & "','" & Me.lst_Name_txt & "')"
#2
1
You're missing an apostrophe: CurrentDb.Execute "INSERT INTO Table2(FirstName, LastName) VALUES('" & Me.frst_Name_txt & "', '" & Me.lst_Name_txt & "')"
您缺少一个撇号:CurrentDb。执行“插入到表2(FirstName, LastName)值(' ' ' & Me. frst_name_txt和' ',' '和Me)中”。lst_Name_txt &”)”