Solved

How to capitalize 2nd,3rd,4th etc. word?

Posted on 1998-02-17
2
198 Views
Last Modified: 2006-11-17
I received the answer from CEkman to capitalize the first word in the entry of a text box and it works great. How to I make this code loop to the next word and so on?
(using ACCESS97)
the following procedure changes the first letter of field [companyname] to upper case. This example puts the code in theAFTERUPDATE event of the field you want to change so the first letter is capitalized whenever the field is modified.

Private Sub CompanyName_AfterUpdate()
Dim x As Variant
Dim newstring As String
newstring = Me![CompanyName]
x = StrConv(Left(newstring, 1), 1)
Mid(newstring, 1, 1) = x
Me![CompanyName] = newstring
End Sub
0
Comment
Question by:bneuman
2 Comments
 
LVL 3

Accepted Solution

by:
guillems earned 50 total points
ID: 1968660
Try to use the next code to do that you ask:

Private Sub CompanyName_AfterUpdate()
  me![CompanyName] = StrConv(me![CompanyName], vbProperCase)
End Sub

This works (see the help for the other parameters that you use in the StrConv.

I hope this help you
0
 

Author Comment

by:bneuman
ID: 1968661
Excellent and fast. Works great....  Thanks.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now