Consulting

Results 1 to 4 of 4

Thread: Solved: truncate and add two text boxes into third

  1. #1
    VBAX Tutor
    Joined
    Dec 2006
    Posts
    271
    Location

    Solved: truncate and add two text boxes into third

    I have a form with 3 text boxes.
    1. First Name
    2. Surname
    3. Shortname

    I want to take the first letter of text box one add a space and add it to the text in text box 2 and display in text box 3


    eg
    First name = Fred
    Surname = Bloggs
    Shortname = F Bloggs

    How do I just get the first letter of text box 1?

    TIA

  2. #2
    Administrator
    2nd VP-Knowledge Base
    VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    Hi lifeson

    How about using the Left() function:
    [vba]Private Sub CommandButton1_Click()
    TextBox3.Text = Strings.Left(TextBox1.Text, 1) & " " & TextBox2.Text
    End Sub[/vba]




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

  3. #3
    VBAX Tutor
    Joined
    Dec 2006
    Posts
    271
    Location
    Thanks Malik
    Nice and simple (same as me )

  4. #4
    Administrator
    2nd VP-Knowledge Base VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location


    No problem




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

Posting Permissions

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