I'm doing a phone directory in Access. Some of my data was in all caps or
all lower case. I want to capitalize the first letter of the name. I am not
Access savvy so please break it down as if I were 5.
You wish to capitalize the first letter, but what about the other
letters (SMITH and Smith both have capitalized first letters).
If the above is OK then code the [LastName] AfterUpdate event:
[LastName] = UCase([LastName],1) & Mid([LastName],2)
If, as I suspect, you wish Proper case (SMITH or smith to Smith), then
code the Control's AfterUpdate event:
[LastName] = StrConv([LastName],3)
Be aware that this will not properly capitalize all words and names,
as some names must always be in all caps (IBM, CBS, etc.), some never
capitalized (e.e. cummings), some have 2 capitals in the name
(McDonald, O'Connor) and some have a mixed set of capitalized names
(van der Meer), as well as all hyphenated names.
The best way to accurately handle names like these is to have a table
of exceptions, and DLookUp the table for that particular word before
changing it.
You would need to create a User Defined function to do all of this and
regularly maintain the list of names, adding new words as needed.
And, after all is said and done, there are still some words and names
that can be written both ways (O'Connor, O'connor, McDonald, Mcdonald)
as well as others whose capitalization depends on useage (ABC, abc,
Xerox, xerox, Access, access).