Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Searching on special char (Access 2003)

    I have 2 tables, each one has a field call last name. I want to compare these 2 fields to see if they have any identical names. But the problem is that some of the names are in French, or with special characters e.g. D'/abc.. When I open a rst "select lastname from tblA where lastname ='" & rstB!Lastname & "'". Here comes the problem. When it comes to D'/abc, the program bombs.

    What should I do? I have no ideas what other special characters will be used.

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Searching on special char (Access 2003)

    Why not join the tables on the Name field and see what that produces.

    eg.
    SELECT tblA.Lastname FROM tblA INNER JOIN tblB ON tblA.Name = tblB.Name

    This will show any duplicates.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Searching on special char (Access 2003)

    Assuming that you don't have names containing double quotes, you can use

    "select lastname from tblA where lastname =" & Chr(34) & rstB!Lastname & Chr(34)

    Also see Chr() function and quotes within strings (all).

  4. #4
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Searching on special char (Access 2003)

    Thanks and I will give it a try.

Posting Permissions

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