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

Converting 1st letter of each word to Capital

Status
Not open for further replies.

shanec

Technical User
Joined
Feb 22, 2003
Messages
6
Location
AU
I have most probably an easy question for somebody.
I would like to convert the first letter of each word in a text box to a capital and all others letter to lowercase after the text box loses focus no matter how the data is entered.
 
Code:
Private Sub TextBox1_Change()
  TextBox1.Text = WorksheetFunction.Proper(TextBox1.Text)
End Sub
 
I am trying to do this in MsAccess, was that example for Excel, sorry for not being specific enough from the start.
I did try this in Access but it didn't work.
 
Yes that was for Excel. There are separate forums for Access and unqualified questions are generally assumed to be for Excel or Word here. You may find better answers in one of the Access forums, for example see forum702.

Meanwhile, I think this is what you are looking for in Access:
Code:
Private Sub Text1_LostFocus()
  Text1.Text = StrConv(Text1.Text, vbProperCase)
End Sub
 
Thnakyou for your help, that works great. I will in future look up the other forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top