Results 1 to 5 of 5
  1. #1
    uronmapu is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    124

    Run-time error '3075' Syntax error (missing operator) in query expression "David's" .

    Dear all



    Please help me fix error message below:

    I have a textbox: Data Source (Text type)

    When I enter: David's contacts and click update button, it have problem with error below:

    Run-time error '3075' Syntax error (missing operator) in query expression "David's" WHERE ID =1'.

    at line code:

    CurrentDb.Execute " UPDATE tblContacts SET [Data Source] = '" & Me.Data_Source & "' WHERE ID = " & Me.ID


    If enter Davids contact (not ' ) it's fine

    Please let me advices
    Many thanks

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    21,716
    This should help:

    http://www.baldyweb.com/BuildSQL.htm

    Specifically the need for Chr(34)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    uronmapu is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    124
    I don't understand, can't fix my problem

  4. #4
    uronmapu is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    124
    Please see my attached file below:
    http://www.mediafire.com/?mbuw4kj01rgpx01

    Logon: admin/admin

    In Search As You Type Example, select a record and double-click

    frnContactDetail will opening,

    In First or Last texbox: if enter ' (Ex: David's contact) --> error

    Please give me advices

  5. #5
    uronmapu is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    124
    I'm using function below, It's fine

    Function ReplaceS(s As String) As String
    ReplaceS = Replace(s, "'", "''")
    End Function

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

Similar Threads

  1. Replies: 2
    Last Post: 03-08-2013, 12:59 PM
  2. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  3. Replies: 5
    Last Post: 03-27-2012, 01:40 PM
  4. Replies: 3
    Last Post: 08-19-2011, 09:06 AM
  5. Syntax error missing operator(3075)
    By parisienne in forum Programming
    Replies: 1
    Last Post: 04-07-2011, 02:29 PM

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 - Senior Forums