RE: CREATE TABLE

Terri Hdokins

Registered User.
Local time
Today, 00:19
Joined
Jun 21, 2001
Messages
15
RE: CREATE TABLE

I am trying to run a VBA code that deletes a table and then creates a new one using DoCmd.RunSQL. Does anyone have any suggestions for syntax using the CREATE TABLE. I keep getting error messages.
HELP!!!!!!!!!
Thanks,
Terri Hodkins
 
I may be wrong, but I don't think you can use the RunSQL method for an Action Query. I always use the Execute method.
 
Do you have any suggestions for an execute method?
 
You can, indeed, run an action query using the DoCmd.RunSQL {query-name} instruction. I do erase-query activations from code all the time and have done append-query from code as well. My application does not usually have to do a table-create, though.

This is a case where "divide and conquer" might be productive. Divide the problem into two components - the query and the code.

If the make-table query won't make a table when activated from the query menu, it won't run from the code either. So the first test is to try your SQL syntax in a manually created query. Get the precise syntax debugged. Then you can work on getting the code to generate the same syntax as a separate (and much simpler step).
 

Users who are viewing this thread

Back
Top Bottom