Capitalisation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to get the first letter of each word in a field to go to
capitals. For example, if user enters the surname "leigh-smith" it would be
stored as "Leigh-Smith".
 
Is there a way to get the first letter of each word in a field to go to
capitals. For example, if user enters the surname "leigh-smith" it would be
stored as "Leigh-Smith".


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

Note: this will incorrectly capitalize some words which contain more
than one capital, i.e. O'Brien, MacDonald, IBM, Jones-Smith, ABC,
etc., and incorrectly capitalize some words that should not have any
capitals, or whose capitaliztion depends upon usage, such as e. e.
cummings, abc, van den Steen.
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.

You can create a table of exceptions and have the code use DLookUp
with a message if one of the exception words is found.
 
....and maybe give the user the chance to click a button somewhere that says
"This should be an exception" that then adds that entry onto the exception
table for future reference.


fredg said:
Is there a way to get the first letter of each word in a field to go to
capitals. For example, if user enters the surname "leigh-smith" it would be
stored as "Leigh-Smith".


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

Note: this will incorrectly capitalize some words which contain more
than one capital, i.e. O'Brien, MacDonald, IBM, Jones-Smith, ABC,
etc., and incorrectly capitalize some words that should not have any
capitals, or whose capitaliztion depends upon usage, such as e. e.
cummings, abc, van den Steen.
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.

You can create a table of exceptions and have the code use DLookUp
with a message if one of the exception words is found.
 
...and maybe give the user the chance to click a button somewhere that says
"This should be an exception" that then adds that entry onto the exception
table for future reference.


Yup.
I have code in the control's AfterUpdate event to DLookUp the
exceptions table and offer a message to retain or change the
capitalization for the current record if an exception is found. As far
as then adding the name to the list, I'm presently doing it manually,
but your idea of adding it to the table by code is a good idea. If I
get time in the next couple of days, I think I'll do it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Excel Comparing two columns 1
Rearranging Name Format 7
2 queries same field 3
Text Split 2
Format Code 1
Adding data from 1 table to another table 5
capitalising after quotation marks 7
Windows 10 How to sort an index created in Word 2013 0

Back
Top