Hi I am creating a payroll at the moment and am stuck on a problem.
When the user creates a new person I want to make sure that the first Character in the name is a Capital. Not sure how to do this.
Any help would be appreciated
Thanks
Printable View
Hi I am creating a payroll at the moment and am stuck on a problem.
When the user creates a new person I want to make sure that the first Character in the name is a Capital. Not sure how to do this.
Any help would be appreciated
Thanks
Use the StrConv function.
Code:Private Sub Text1_Change()
Text1 = StrConv(Text1, vbProperCase)
End Sub
not sure if theres a better (easier) way of doing it but:
Code:Dim myName As String
myName = "sajendra"
myName = UCase$(Left(myName, 1)) + Right$(myName, Len(myName) - 1)
MsgBox myName
Heh, Megatron posted a better answer and faster too. Why am I not surprised.