Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Syntax error (Access 2000)

    I have an syntax error,missing operator which i cannot find in the following code:

    Public Function MakeNewTable()
    Dim sql As String
    Dim SelectOrder As String
    SelectOrder = "140364,140365"
    sql = "SELECT * INTO orders1 FROM orders WHERE orders.orderid = In (" & SelectOrder & ")"
    CurrentDb.Execute sql
    End Function

    Could you tell me what is the reason?

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Syntax error (Access 2000)

    You have an extra = sign in this line.

    sql = "SELECT * INTO orders1 FROM orders WHERE orders.orderid = In (" & SelectOrder & ")"

    should be

    sql = "SELECT * INTO orders1 FROM orders WHERE orders.orderid In (" & SelectOrder & ")"
    Regards
    John



  3. #3
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Syntax error (Access 2000)

    Thank you

Posting Permissions

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