Solved

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

Posted on 1998-02-17
2
205 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

863 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

26 Experts available now in Live!

Get 1:1 Help Now