Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    missing operator (Access 2000)

    I get a syntax error :missing operator on opening a form,provided thatthe main form has been opened.The man form contains options of different branches
    as branch0,branch1,etc.I have found this wonderful usage in the Forum,but this time i get a syntax error.
    May i ask for help?

    Dim city As Long
    city = Forms![FOrderInformation]![office] - 1
    Dim bas As String
    bas = " SELECT DISTINCTROW products.Productid, products.grade, products.size, products.pack, products.branch " & city & " FROM products"
    Me.RecordSource = bas

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

    Re: missing operator (Access 2000)

    There shouldn't be a space after products.branch in the string. As it is now, it'll come out as<pre>products.branch 1</pre>

    instead of<pre>products.branch1</pre>

    so SQL expects a + or - or other arithmetic operator between products.branch and 1.

Posting Permissions

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