Click to See Complete Forum and Search --> : Convert the lowerc ase first letter in a Name to upper letter.


Beth Poka
September 12th, 2001, 01:05 PM
HI All,

I've a text control that allows a user to type in their name. How do I convert their first letter of their name in lowercase to uppercase automatically, soon as they tab to the next field.

Thanks in advance!

Beth

Andrew R.
September 12th, 2001, 01:27 PM
Assume your text box name is "Text1".

private Sub Text1_LostFocus()
Dim strTemp as string
strTemp = Text1.Text
mid(strTemp, 1, 1) = UCase(Left(Text1.Text, 1))
Text1.Text = strTemp
End Sub

d.paulson
September 12th, 2001, 01:28 PM
Text1 = StrConv(Text1, vbProperCase)

David Paulson