I am usually able to figure this stuff out on my own nowadays, but I am really stuck, so I defer to your knowledge.
I am trying to use .Execute to run SQL to create a table in the database, the problem is that the table name is a string value that was determined through code.
If I don't use a string for the table name, I don't get an error, but with a string I am getting a syntax error that I can't seem to fix. Here is an example:
Anyone have an idea? I think it's a problem with quote's somewhere.
I am trying to use .Execute to run SQL to create a table in the database, the problem is that the table name is a string value that was determined through code.
If I don't use a string for the table name, I don't get an error, but with a string I am getting a syntax error that I can't seem to fix. Here is an example:
Code:
StrTablename = "Autopay Accounts"
Currentdb.Execute "CREATE TABLE " & StrTablename & " (RecordStatus varchar(2))"
Anyone have an idea? I think it's a problem with quote's somewhere.