A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

capitalise the first letters of two or more words



 
 
Thread Tools Display Modes
  #1  
Old June 17th, 2008, 09:29 PM posted to microsoft.public.access.tablesdbdesign
hammie
external usenet poster
 
Posts: 1
Default capitalise the first letters of two or more words

I am trying to capitalise the first letter of two or more words automatically
e.g. Henry Fonda as opposed to just the "H" being capitalised. have searched
everywhere. I am fairly new at this but cannot find a suggestion that work
ks. evryone suggest L?????? but this only does the first letter of the
first name...anyone?..help???
  #2  
Old June 17th, 2008, 10:46 PM posted to microsoft.public.access.tablesdbdesign
fredg
external usenet poster
 
Posts: 4,386
Default capitalise the first letters of two or more words

On Tue, 17 Jun 2008 13:29:01 -0700, hammie wrote:

I am trying to capitalise the first letter of two or more words automatically
e.g. Henry Fonda as opposed to just the "H" being capitalised. have searched
everywhere. I am fairly new at this but cannot find a suggestion that work
ks. evryone suggest L?????? but this only does the first letter of the
first name...anyone?..help???



NOTE: Entering the First Name and Last Name in one field is not the
proper way to store data in Access. You should have 2 fields, one for
the First Name and another for the Last Name.
If you also wish to store a Middle Initial or Middle Name, add a 3rd
field. It's very easy to combine the names (in a report or on a form)
but quite difficult to separate them when needed.

That being said, you are using a form for data entry? Right?

Enter the data however you wish, i.e. henRY fOndA

On the Form's control's AfterUpdate event code:
Me![ControlName] = StrConv([ControlName],3)

Henry Fonda will be stored.

Note: this will incorrectly capitalize some words which contain more
than one capital, i.e. O'Brien becomes O'brien, MacDonald becomes
Macdonald, Jones-Smith becomes Jones-smith, ABC becomes Abc, etc., and
incorrectly capitalize some words that should not have any capitals or
whose capitalization depends upon usage, such as e. e. cummings, van
den Steen, van Beethoven, etc., will all be incorrectly capitalized.
Then some names can be capitalized in more than one manner, depending
upon personal preference, i.e. O'Connor and O'connor, McDaniels and
Mcdaniels, etc., are both correct.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old June 17th, 2008, 11:14 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default capitalise the first letters of two or more words

On Tue, 17 Jun 2008 13:29:01 -0700, hammie
wrote:

I am trying to capitalise the first letter of two or more words automatically
e.g. Henry Fonda as opposed to just the "H" being capitalised. have searched
everywhere. I am fairly new at this but cannot find a suggestion that work
ks. evryone suggest L?????? but this only does the first letter of the
first name...anyone?..help???


A Format won't work: it's a pretty limited feature.

You can use an Update Query to update the field in the table to

StrConv([fieldname], 3)

to use "proper case" - this will convert "henry fonda" to "Henry Fonda".
Unfortunately it will also convert "Ian McIntyre" to "Ian Mcintyre", and
"byron de la beckwith" to "Byron De La Beckwith" - capitalizing only the first
letter of each word.

You *should* be storing the firstname and the lastname in separate fields,
though.
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:06 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.