Syntax error in INSERT INTO?

Danielf

Registered User.
Local time
Today, 23:11
Joined
Feb 21, 2000
Messages
103
Hi,


I am trying to insert into table 1 the fields "title" and "size" from table 2. I have tried the following syntax

Set dbs = CurrentDb()
dbs.Execute " INSERT INTO table1 (title,size)" & "SELECT * " & "FROM [table2];"
But nothing happens.

Thanks for help.

Daniel
 
Use explicit fieldnames
Code:
dbs.Execute "INSERT INTO table1 (title, size) SELECT title, size FROM table2;"
 
Use explicit fieldnames
Code:
dbs.Execute "INSERT INTO table1 (title, size) SELECT title, size FROM table2;"

But the names "Title" and "size" are the name of the fields in my table.

Daniel
 
- Yes? -

You have to use explicit fieldnames and not an asterisk (*)
 

Users who are viewing this thread

Back
Top Bottom