Results 1 to 3 of 3
  1. #1
    darwish is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    26

    error while inserting a word containing apostrophe ( ' )

    hello

    i have a text box.
    i insert a word in the text box and press the add button, here the word is being checked if it is already inserted into the database by the DLookUp method, and if it is not found, then it will be inserted normally by SQL insert statement.
    I have 1 error appear when i enter a word having an apostrophe ex: Car's
    The error is the following: Syntax error (missing operator) in query expression '[Customer_Name]='car's"

    any word that don't have an apostrophe is working fine.

    any help is appreciated.

    Thank you

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,537
    You may find the following link of some help: http://allenbrowne.com/casu-17.html
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    use a browser to search for dlookup, select the top answer from microsoft, there should be examples of dlookup options.

    Yous is missing quotes single and double to allow for your problem of the extra apostrophe.
    the dlookup is formatted differently for numbers, text and dates.

    sample for text...
    DLookup("[image location]", "[images]", "[Con Note Number] =
    '" & Me.Consignment_Note_Number & "'")

    note the extra single and double quotes there, ensure that your spaces are also set correctly.

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

Similar Threads

  1. inserting records into word from access
    By sssandhya89 in forum Access
    Replies: 1
    Last Post: 03-22-2013, 11:33 AM
  2. Replies: 12
    Last Post: 10-22-2012, 06:11 AM
  3. Replies: 5
    Last Post: 09-05-2012, 09:28 AM
  4. error on inserting value
    By dada in forum Programming
    Replies: 3
    Last Post: 08-18-2010, 11:28 PM
  5. Replies: 0
    Last Post: 05-14-2009, 12:34 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