Results 1 to 5 of 5
  1. #1
    Access_Novice is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Posts
    265

    Syntax error (comma) in query expression


    I am in query design. I am trying to put a query together and I am getting this syntax error. The error points to this field:

    adjNum2: Replace([adjNum],Chr(160),"")

    What is wrong with this?

  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,930
    What is code 160 for - a space? Try:

    adjNum2: Replace([adjNum], " ", "")
    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
    Access_Novice is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Posts
    265
    Quote Originally Posted by June7 View Post
    What is code 160 for - a space? Try:

    adjNum2: Replace([adjNum], " ", "")

    It's a non-printing HTML character of some sort which comes from copying data from the web.

  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,930
    I don't know why it errors. I just tested the Replace with Chr(160) and did not error. I copy/pasted text from a web page but I don't know if it had that non-printing character so can't tell if anything was replaced.
    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.

  5. #5
    Access_Novice is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Posts
    265
    Quote Originally Posted by June7 View Post
    I don't know why it errors. I just tested the Replace with Chr(160) and did not error. I copy/pasted text from a web page but I don't know if it had that non-printing character so can't tell if anything was replaced.
    Thank you for looking into this.

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

Similar Threads

  1. Replies: 11
    Last Post: 05-01-2014, 11:56 AM
  2. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  3. Replies: 1
    Last Post: 11-30-2011, 01:13 AM
  4. Syntax error (comma) in query expression?
    By TheWolfster in forum Queries
    Replies: 5
    Last Post: 05-10-2010, 12:02 PM
  5. Syntax error (comma) in query expression
    By KLynch0803 in forum Programming
    Replies: 3
    Last Post: 01-18-2010, 03:35 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