Results 1 to 4 of 4
  1. #1
    newtoAccess is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    226

    Getting first Char form a Field

    I need to get the first char of the field F_Name. For address lables.
    Eg Mrs. x Smith I nedd to get the x.
    Should I use a query or can I do it directly in a table?
    how do I do it?


    Thanks

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    if you F_Name is like "Mrs. x Smith ", it is a complicated case, because we need a knowledge table about the solutations: MRS. MR. MR MRS DR DR. MS etc. we need to get rid of those solutations and then get the first char.

    when you try to get rid of the solutations, please consider:
    1 no solutation
    2 name may not have space between solutation and name, like "MRS. X smith" and "MRS.X smith"
    3 solutation may not have a dot, like "MRS X smith"
    4 Is there any case that have two-word-solutation? like "DR MS x smith".

    after get rid of the solutation, use left function to get first char:
    nName: left(name_without_solutation,1)

  3. #3
    newtoAccess is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    226

    problem continues:

    They are already seperated fields.

    Where do I use Left(FName,1) in a querry or in the main table? or someplae else.
    How?
    I tried Left("TableNameHere!L_Name",1) and kept getting errors.

  4. #4
    ducecoop is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2010
    Posts
    41
    Not the expert here (I am posting a lot of questions my self)
    But
    I would make a hidden field called (new field in DB, hidden field on your form)
    f_nameLabel

    On the "after update" event of the first name field
    code
    me.f-NameLabel = Left(f_name,1)

    when printing your label pull from f_nameLabel not from f_name

    hope that helps a little

    This is all assuming I understand you correctly the the sirname is in a different field

Please reply to this thread with any new information or opinions.

Similar Threads

  1. FORM FIELD based on another form EASY ???
    By jaketsuar in forum Forms
    Replies: 4
    Last Post: 05-29-2010, 06:25 PM
  2. Replies: 6
    Last Post: 04-30-2010, 01:57 PM
  3. 8000 char max for memo?
    By okerix in forum Access
    Replies: 0
    Last Post: 04-29-2010, 08:55 AM
  4. Comparing form field with the field from database
    By np1111 in forum Programming
    Replies: 1
    Last Post: 03-22-2010, 10:01 AM
  5. In a field on a Form, on click open another form
    By jackieagra in forum Programming
    Replies: 1
    Last Post: 03-20-2008, 09:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums