Insert Into

  • Thread starter Thread starter louis
  • Start date Start date
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 & "')"
 
You are getting lost on the quotes

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

Chris
 
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'.
 
Back
Top