Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2009
    Posts
    10

    Unanswered: Text format first name

    I have a table that defines the first name field (LtrVFirstName) size of 30.

    I want to be able to pick up names in this field without chopping off the second part of a first name.

    Example first name is De Loa. When the report letter is created, the "LOA" is being truncated.

    The letter should begin Dear De Loa: not Dear De:

    I have no problems with hyphenated first names. i.e. John-Paul.

    What is the fix (in the table) for that field?

    Thanks,

    Frank

  2. #2
    Join Date
    May 2009
    Posts
    258
    I'm guessing the LtrVFirstName receives data from a splitted field, which is why you are having this problem. See the below link for a possible solution:
    LauraJ's Weblog : Excel tip: Split first name and last name into separate cells

    You'd want to get the correct data at the time the value is set in the field.

    Regards,

    Ax

  3. #3
    Join Date
    Jun 2009
    Posts
    10

    Access response would be more helpful

    Quote Originally Posted by Ax238
    I'm guessing the LtrVFirstName receives data from a splitted field, which is why you are having this problem. See the below link for a possible solution:
    LauraJ's Weblog : Excel tip: Split first name and last name into separate cells

    You'd want to get the correct data at the time the value is set in the field.

    Regards,

    Ax
    The field receives the entire first name. I'm looking for a format string to ensure I don't loose non hyphenated first names.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I suspect that you have some code which chops the first name column on the first space... look for an expression using split or instr
    I think you need to consider developing a function or a rules table that caters for each variant (eg De, von, di and so one)
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    I agree with healdem, it shouldn't matter whether LtrVFirstName has spaces in it or not, if you're simply using LtrVFirstName in your report, the entire name should appear. This sounds like you have some type of parsing hack in place that's only pulling everything before the first space.

    If, for example, you originally had a single name field, such as

    John Smith

    you would use Instr() and Left() to pull the first name out of the entire name.

    FirstName = Left(WholeNameField,InStr(WholeNameField," "))
    Last edited by Missinglinq; 07-02-09 at 20:10.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Ive seen thsi sort of thing before
    where someone has stripped off any names more than one
    eg
    "Peter John" becomes "Peter"
    however if you are working on de thats usually attached to the surname, where usually you would use the whole surname. one approach is to store a column called say preferred name so someone called Franklyn Mahoney can style them sleves as either Frank, Franklyn or even Mahonri1

    prefix's to surnames can cause problems for sort orders and so on, so I've seen functions that chop out de,von,di etc do the sort but then use the surname as registered..

    In short I don;t think there is an easy way of doing this short of writing a function which handles the processing you feel you need to do. then for performance reasons you may choose to store the result of that function in the table
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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