Results 1 to 5 of 5

Thread: trim (2000)

  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    trim (2000)

    Hello, how can I trim text that is put into the to: box of an e amil. VB extracts a name field from a form into the e mail but the field for instance shows
    john smith - ALO, I need some code to trim the ALO. Many thanks

    Darren.

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

    Re: trim (2000)

    Please explain precisely what should be removed. Does the field always contain a dash? Should everything from the dash be removed?

  3. #3
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: trim (2000)

    Thanks Hans, there is the name, a space, the dash, a space then the 3 letters. Would like just the name to remain with the spaces after, the dash and the three letters to be removed.

    Thanks again Darren.

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

    Re: trim (2000)

    If the control is named txtName, the expression
    <code>
    Left([txtName], InStr([txtName], "-") - 2)
    </code>
    will return only the name. If you change the - 2 to - 1, you'll keep the space after the name.

  5. #5
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: trim (2000)

    Thansk Hans.

    Darren.

Posting Permissions

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