Results 1 to 4 of 4
  1. #1
    MeaganN is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    2

    Syntax error (missing operator) in query expression - Access 2010

    Hello

    I am getting the following syntax error (missing operator) in query expression on the below query. I have rewritten the query several times, all my table names and pathways are correct and I am at a loss as to the error in the below code:

    Me!ProductName.RowSource = "SELECT DISTINCT [Register of Raw Materials].[Product Name].Value" _
    & "FROM [Register of Fibre Suppliers]" _
    & "INNER JOIN [Register of Raw Materials]" _
    & "ON [Register of Fibre Suppliers].ID = [Register of Raw Materials].[Supplier Name]" _
    & " IN '\\pmtwfp0001\public\AP PUBLIC\Chain of Custody Systems\AFS CoC Database\Test_be.accdb'" _


    & "WHERE [Register of Raw Materials].[AFS Risk] Not Like 'Significant' AND [Register of Fibre Suppliers].[Supplier Name]='" & Me.Supplier.Column(0) & "'"
    The query is in an Access 2010 database and is an "After Update" event. Any help to solve this error would be much appreciated

    Thanks Meagan

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Need a space at the end of each line before the quote mark so the text doesn't run together when the statement compiles.

    Don't need .Value because Value is default although don't think it hurts.

    Also probably doesn't hurt but LIKE is not really useful without wildcard. Use <> instead of Not Like.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    MeaganN is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    2
    That's for replying so quickly and for your advice.
    I am no longer getting the syntax error however I am receiving the following message instead "Cannot reference a table with a multi-valued field using an IN clause that refers to another database".
    I have tested the query with and without the .Value and still get the same message. I have also used .Text as the field that will be selected from the relevant table is a text field.
    Any further suggestions?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    The message says there is a field set up as a multi-value. Text or number, it can still be multi-value. I NEVER use multi-value fields.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 03-27-2014, 09:43 AM
  2. Replies: 2
    Last Post: 02-17-2014, 10:27 AM
  3. Replies: 1
    Last Post: 06-02-2013, 04:34 AM
  4. Replies: 9
    Last Post: 01-22-2013, 04:23 PM
  5. Replies: 1
    Last Post: 10-07-2009, 07:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums