Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Location
    Birmingham, AL
    Posts
    3

    Question Unanswered: Name Manipulation

    First I should say I am not familiar with Visual Basic.

    I am trying to break up a name field with various name formats into 2 separate fields:
    1. firstname and initial, if included
    2. lastname, and suffix if included

    The various name formats are similar to these:

    Mr. & Mrs. John R. Smith, III

    Mr. Henry B. Jones & Ms. Hillary Loper

    Kay M Conroy Peckham

    Thomas F & Joyce Mlyniec

    J. Smith, MD

    Can anyone help?

    Thank you!

  2. #2
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    easily done in VB
    though not what yout looking for this is something i've done resently it's designed to append a '&' sign between the last 2 elements of a list instead of a comma

    Message = (Left$(Message, InStrRev(Message, ",") - 1) & " &" & Right$(Message, Len(Message) - InStrRev(Message, ",")))

    the commands you need are Left$, Right$ and Instr (or InStrRev if you inclued middle names and want the surname)

    you will need to screen the MR, MRS, MD, etc from them first, if they're vital store them in a variable and remerge it later

    if you cant figure the code drop me a Email and i'll try to lend a hand
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

Posting Permissions

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