Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Concatenation problem

    I am trying to concatenate NameHusband, NameWife, and LastName, where either the husband´s or the wife´s name may be missing. I am OK with a missing wife´s name by using the + symbol rather than the &, but when I throw in the possible missing husband´s name, I can´t get things to work.

    Can somebody help?

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,533
    Thanks
    0
    Thanked 23 Times in 23 Posts
    please explain this in moredetail.
    Are you using NameHusband + NameWife + LastName?

  4. #3
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes. Here is where I am now.

    Expr1: [tblColonMst]![FstNameHus] & (" y "+[tblColonMst]![FstNameWfe]) & " " & [tblColonMst]![LastName1]

    If I have no FstNameHus, I get the "y" in front of FstNameWfe. If I have no FstNameWfe, it works.

    Thanks for the attention.

  5. #4
    New Lounger
    Join Date
    Sep 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try this:

    [tblColonMst]![FstNameHus] & (IIF(Nz([tblColonMst]![FstNameHus])="",""," y ")+[tblColonMst]![FstNameWfe]) & " " & [tblColonMst]![LastName1]

    This adds the " y " only if the FstNameHus is not blank. It should work even if your fields allow zero-length strings.
    Last edited by Mike J; 2013-06-06 at 14:22. Reason: I realized my first answer was wrong.

  6. #5
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you.

    Do you guys realize how much you help?

Posting Permissions

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