Results 1 to 4 of 4
  1. #1
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451

    text with odd characters


    i have an unbound entry form with a SQL INSERT on a command button. works great till i tested it with the word "don't". didn't like the apostrophe so i changed from ,'" & me.txtdetail.value & "', to """ & me.txtdetail.value & """ and it works great again but just for giggles i then tried putting quote marks in my text box with a word and it didn't like that. i'm sure that someone entering information into this will try to use some unusual characters since it is a description of the incident entry box. how is the best way to handle this?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    The subject of what you are dealing with is called escaping unwanted characters.

    Here is a link to assist.
    http://stackoverflow.com/questions/1...ion-and-implem


    Good luck.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    Apostrophe and quote marks have special purpose in SQL. They are text delimiters that define the begin and end of text strings. As orange's link demonstrates, must 'escape' the special characters so SQL will process them as literal text. Doubling a special character does this. The Replace function will accomplish this without actually changing the raw saved data.
    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.

  4. #4
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    thanks orange. oh boy, more reading

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

Similar Threads

  1. Replies: 4
    Last Post: 07-14-2015, 11:41 AM
  2. Text box with more than 255 characters
    By ssissons in forum Forms
    Replies: 6
    Last Post: 07-25-2014, 08:32 AM
  3. Replies: 1
    Last Post: 05-01-2014, 11:33 AM
  4. enter more than 255 characters in a text box
    By reddy4305 in forum Access
    Replies: 2
    Last Post: 10-26-2010, 06:29 AM
  5. characters in text boxes
    By Matthieu in forum Access
    Replies: 0
    Last Post: 04-08-2010, 11:02 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