Hi,
I am trying to make the code shown below work....and I get the error message: Syntax error in query. Incomplete query clause.
Here is the code...I cannot figure out why it won't work.
Any ideas?
Dim cpyText As String
Dim sql As String
Dim newName As String
cpyText = List11.Column(0, List11.ListIndex)
fld_lname.SetFocus
newName = fld_lname.Text
sql = "INSERT INTO '" & newName & "' ([perm]) VALUES ('" & cpyText & "')"
DoCmd.RunSQL (sql)
When I hit the debug button on the error dialog box, the highlighted text is the DoCmd.RunSQL (sql). When I hold the cursor over the (sql)...the sql statement reads as I think it should...meaning the variables are replaced with the correct data values.
So what is wrong with the statement? I know it is probably something simple and obvious.
Thanks,
Mike
I am trying to make the code shown below work....and I get the error message: Syntax error in query. Incomplete query clause.
Here is the code...I cannot figure out why it won't work.
Any ideas?
Dim cpyText As String
Dim sql As String
Dim newName As String
cpyText = List11.Column(0, List11.ListIndex)
fld_lname.SetFocus
newName = fld_lname.Text
sql = "INSERT INTO '" & newName & "' ([perm]) VALUES ('" & cpyText & "')"
DoCmd.RunSQL (sql)
When I hit the debug button on the error dialog box, the highlighted text is the DoCmd.RunSQL (sql). When I hold the cursor over the (sql)...the sql statement reads as I think it should...meaning the variables are replaced with the correct data values.
So what is wrong with the statement? I know it is probably something simple and obvious.
Thanks,
Mike