Results 1 to 5 of 5
  1. #1
    preveo is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2014
    Posts
    10

    Syntax error (Missing operator) in query expression

    Hi,



    I've been using access for years and went to create a new database today in Access 2016 and kept getting the error Syntax error (Missing operator) in query expression when i was filtering records either in table view or query view.

    I've worked out that it's because there are spaces in the field names and if I put an _ where the spaces were then I won't get these messages.

    Why has this changed? I hate all these little _ I have to put in.

    Is there a setting I can change so I can use spaces in my field names?

    Why have microsoft changed this?

  2. #2
    preveo is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2014
    Posts
    10
    I've subsequently seen in access it clearly says a field name can include spaces, so any-one know what's happening?

  3. #3
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Spaces have always been allowed in field names.

    I'm not familiar with A2016, so I don't know about underscores replacing spaces (I doubt it will work, because the underscore is a valid character in field names). However, if you enclose your field names in square brackets [like this], then the queries should work. It's always been like that.

  4. #4
    preveo is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2014
    Posts
    10
    Well something's changed and it's got nothing to do with square brackets in queries. If I create a query based on the simpliest database of one table with one field in it with two records and then run a query on it to bring up the records and then filter AFTER the query has been run, then it will throw up the message.

  5. #5
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Please post the code that's causing the error, otherwise all we can do is guess.

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

Similar Threads

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

Tags for this Thread

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