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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capitalizing the First Letter 1

Status
Not open for further replies.

pungy

Instructor
Aug 5, 2007
71
US
VB 6 Enterprise Edition

I am writing an application that the user enters people names in text boxes. The text boxes are know by the names: txtFirstName, txtLastName, txtNameSuffix, and txtPhoneNumber.

I would like to write a routine whereby I can be assured that the 1st letter of ever name is a capital, the rest are lower case. This would be true with all text boxes except the txtPhoneNumber. Example: (user enter: john); textbox display: John) or (user enter: joHn); textbox display: John) or any combination.


Does anyone know how to do this?
 
don't overlook names like O'Brien, Mc Mahon, Mac Dermot and double-barrelled names.
 
howabut:

Dim strtestit As String
strtestit = "john"
Debug.Print StrConv(strtestit, vbProperCase)

keenanbr are a bump in the road.
 
TysonLPrice:
Thank you. I'm retired now but use to teach this stuff. It's amazing what you forget. The old saying "Use it or Lose it".

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top