Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    May 2003
    Location
    Sacramento, California, USA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Concatenation Question (A2K)

    I am developing a report to function as a confirmation letter. In the name/address portion, I want a period to appear after the middle initial ONLY IF there is a middle initial. I've got this working perfectly in the case of a suffix if there is one but I can't make it work for the MI. Here is what I have as the control source:

    =([chrFirstName]+" ") & (+[chrMiddleInitial]+". ") & [chrLastName] & (", "+[chrSuffix]+".") & (", "+[chrDegree]) & Chr(13) & Chr(10) & [chrStreetOne] & (", "+[chrStreetTwo]) & Chr(13) & Chr(10) & [chrCity]+", " & [chrState]+". " & [chrZip5]

    Any help?

    Thanks

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

    Re: Concatenation Question (A2K)

    There shouldn't be a + before [chrMiddleInitial]

  3. #3
    3 Star Lounger
    Join Date
    May 2003
    Location
    Sacramento, California, USA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Concatenation Question (A2K)

    Hi Hans,

    I removed the + from before chrMiddleInitial. The period is still showing up when there is no middle initial, however. Is there something at the end of that expression that's causing this to malfunction?

    Thanks

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

    Re: Concatenation Question (A2K)

    Try this instead of ([chrMiddleInitial]+"."):
    <code>
    IIf(Trim(Nz([chrMiddleInitial],""))="","",[chrMiddleInitial] & ".")</code>

  5. #5
    3 Star Lounger
    Join Date
    May 2003
    Location
    Sacramento, California, USA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Concatenation Question (A2K)

    <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>
    Thanks Hans, worked like a charm!

Posting Permissions

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