Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    syntax error insert into (Access 2000)

    Could you help me find the syntax error of the inert into statement shown below
    Dim strAppendProduct As String
    strAppendProduct = "INSERT INTO Products " & _
    "SELECT " & _
    " FROM Pricelist As o1 WHERE NOT EXISTS (SELECT * FROM Products WHERE " & _
    "code=o1.code)"
    CurrentDb.Execute strAppendProduct

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: syntax error insert into (Access 2000)

    You don't specify what you select from Pricelist. Change
    <code>
    "SELECT " & _
    </code>
    to
    <code>
    "SELECT * " & _
    </code>
    General tip: try out SQL by designing a query first. When the query works to your satisfaction, look at its SQL (View | SQL) and use this to build your VBA code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •