Results 1 to 4 of 4
  1. #1
    kelann is offline Learning ... thank you!!
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    132

    Combo Box / Lookup List not finding items with an apostrophe

    My "After Update" Macro for a combo box (SearchByOrganization) is thus -- it finds the organization, then "resets" itself to blank:
    SearchForRecord
    Record First
    Where Condition ="[OrgName] = " & "'" & [Screen].[ActiveControl] & "'"

    SetProperty
    Control Name SearchByOrganization


    Property Value
    Value [Blank]

    Howver, sometimes the OrgName field contains apostrophes. In these cases, it only does the 2nd part -- resets itself to blank -- without finding the record. I've tried using a double quote in place of the single quote (see red text ="[OrgName] = " & """ & [Screen].[ActiveControl] & """), but then it didn't find anything.

    Any thoughts?

    I've googled, but I couldn't figure out how to word/adapt the chr(34) language.

    Thanks so much!

    --ak

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Try

    Where Condition ="[OrgName] = " & chr(34) & [Screen].[ActiveControl] & chr(34)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    kelann is offline Learning ... thank you!!
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    132
    You are the best!

    Thanks, Paul!!!!!!!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 5
    Last Post: 03-12-2012, 02:58 AM
  2. Replies: 3
    Last Post: 11-26-2011, 07:55 PM
  3. Replies: 2
    Last Post: 05-11-2011, 02:58 PM
  4. Replies: 4
    Last Post: 04-05-2011, 06:12 PM
  5. Lookup column relating items in same field
    By rmroberts76 in forum Access
    Replies: 8
    Last Post: 06-05-2010, 07:41 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