Insert Into

L

louis

I try to insert string "Where parts='0005'" into Table but
it has error. Please advise.

dim strpart as string
strpart = "0005"
CurrentDb.Execute "Insert Into Table1(strWhere) Values
('Where Parts= '" & strpart & "')"
 
C

Chris

You are getting lost on the quotes

CurrentDb.Execute "Insert Into Table1(strWhere) Values
(""Where Parts= '" & strpart & "'"")"

Chris
 
J

John Smith

There is no WHERE clause in an INSERT statement. Use the builder to create an
insert query, then look at it in SQL view. That will show you what it should
look like. Alternatively, look in Help for 'INSERT INTO'.
 
Top