Setting a text field to first letter UpperCase

G

Guest

How can I format a text box to start with Uppercase first letter. I am using
the text box to capture names and would like to start them with a capital
letter and then the remaining as lower case.
 
A

Allen Browne

Jack, you can do this in the AfterUpdate event procedure of the text box as
shown below.

However, this is still going go give you problems with people such as:
van Leen
Von Trap
McDonald

Private Sub Text1_AfterUpdate
With Me.[Text1]
If Len(.Value) > 1 Then
.Value = StrConv(Left(.Value,1), vbUpperCase) & Mid(.Value, 2)
End If
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top