Solved

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

Posted on 1998-02-17
2
210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

726 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