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'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top