G
Gene
I'm trying to run a make table SQL where the field
CodeName is a variable and the name of the new table is a
variable
Dim gbTableName As String
gbTableName = "RESP"
DoCmd.RunSQL "SELECT Link.CodeName, Link.CodeValue,
Link.Description, Link.SortOrder INTO '" & gbTableName
& "' FROM Link WHERE (((Link.CodeName)=[Forms]![Form1]!
[Text2]));"
When I run this I get the following error:
"Run-time error '3450': Syntax error in query. Incomplete
query clause."
I get the same error when I run it as this:
DoCmd.RunSQL "SELECT Link.CodeName, Link.CodeValue,
Link.Description, Link.SortOrder INTO ' & gbTableName & '
FROM Link WHERE (((Link.CodeName)=[Forms]![Form1]!
[Text2]));"
When I run it like this
DoCmd.RunSQL "SELECT Link.CodeName, Link.CodeValue,
Link.Description, Link.SortOrder INTO & gbTableName & FROM
Link WHERE (((Link.CodeName)=[Forms]![Form1]![Text2]));"
I get the following error:
"Run-time error '3141': The SELECT statement includes a
reserved work or an argument name that is misspelled or
missing, of the punctuation is incorrect."
Is possible to do what I am trying to do?
Thank you.
Gene
CodeName is a variable and the name of the new table is a
variable
Dim gbTableName As String
gbTableName = "RESP"
DoCmd.RunSQL "SELECT Link.CodeName, Link.CodeValue,
Link.Description, Link.SortOrder INTO '" & gbTableName
& "' FROM Link WHERE (((Link.CodeName)=[Forms]![Form1]!
[Text2]));"
When I run this I get the following error:
"Run-time error '3450': Syntax error in query. Incomplete
query clause."
I get the same error when I run it as this:
DoCmd.RunSQL "SELECT Link.CodeName, Link.CodeValue,
Link.Description, Link.SortOrder INTO ' & gbTableName & '
FROM Link WHERE (((Link.CodeName)=[Forms]![Form1]!
[Text2]));"
When I run it like this
DoCmd.RunSQL "SELECT Link.CodeName, Link.CodeValue,
Link.Description, Link.SortOrder INTO & gbTableName & FROM
Link WHERE (((Link.CodeName)=[Forms]![Form1]![Text2]));"
I get the following error:
"Run-time error '3141': The SELECT statement includes a
reserved work or an argument name that is misspelled or
missing, of the punctuation is incorrect."
Is possible to do what I am trying to do?
Thank you.
Gene