Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Now-Luanda, Angola, Originally - Anna Bay, New South Wales, Australia
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Apostrophe (2000 SP3)

    Have a combo box to choose names. Whenever I choose a name with an apostrophe (eg O'Halloran), I get "Run time error 3077 - Syntax error (missing operator) in expression". Any ideas
    Steve
    Dummy from Down Under <img src=/S/flags/Australia.gif border=0 alt=Australia width=30 height=18>

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Apostrophe (2000 SP3)

    In the code in the afterupdate event you will have something like:

    rs.FindFirst "[name] = ' " & Me![name] & "'"

    those are single quotes around me!name

    When the name has an apostrophe in it, you end with up with three apostrophes.

    Change it to

    rs.FindFirst "[name] = " & chr(34) & Me![name] & chr(34)

    Chr(34) is a double quote
    Regards
    John



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •