Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple input mask question 1

Status
Not open for further replies.

medic133

Technical User
Apr 7, 2002
86
US
I have a text box on a form that users enter their name as first name followed by last name separated by a space. I want to ensure the first letters of each name are capitalized. I tried to do this with the following input mask:

>L<?????????/ >L<????????

This works for names with the above number of characters. Is there an easy way of doing this for names of varying length? I've thought about trapping keys, but I am hoping there is an easier way. Any help would be greatly appreciated!!
 
Place in the after update of your textbox control

Dim strname As String
Dim strname1 As String

strname = Left(Me.Text0, 1)
strname1 = UCase(strname)
Me.Text0.Value = strname1 & Mid(Text0.Value, 2)

This will change the first letter to capital. hope it helps.
 
try me.text0=StrConv(me.text0,vbpropercase) in the afterupdate of the control
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top