?
Solved

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

Posted on 1998-02-17
2
Medium Priority
?
211 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 200 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

741 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