PDA

View Full Version : Solved: truncate and add two text boxes into third



lifeson
07-25-2007, 10:03 AM
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? :dunno

TIA

malik641
07-25-2007, 10:09 AM
Hi lifeson :hi:

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

lifeson
07-25-2007, 11:13 AM
:hi: Thanks Malik
Nice and simple (same as me :rotlaugh: )

malik641
07-25-2007, 11:42 AM
:)

No problem :thumb