Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use 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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

618 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