How to convert a string to Proper Case

G

Guest

Hi!

My problem is how to convert a text to proper case for example mARK anders
==> Mark Anders. It works with following function, but the field cannot be
edit:

Function Aa(strToChange As String) As String
On Error Resume Next
Aa = StrConv(strToChange, vbProperCase)
End Function

Using the function in a field, for example: =Aa(Name)

How can I use that function and keep the field editable?
Thanks in advance!

Have a Nice Day!
 
F

fredg

Hi!

My problem is how to convert a text to proper case for example mARK anders
==> Mark Anders. It works with following function, but the field cannot be
edit:

Function Aa(strToChange As String) As String
On Error Resume Next
Aa = StrConv(strToChange, vbProperCase)
End Function

Using the function in a field, for example: =Aa(Name)

How can I use that function and keep the field editable?
Thanks in advance!

Have a Nice Day!

Mark,
You asked, and Steve answered you, about Proper Case in fields.

A person's name is important to them.

It's not quite as simple a question as you asked, nor is the answer as
easy as Steve suggested.

Yes, using StrConv() after entering mARK anders the name will be
converted properly to Mark Anders, but how should Access capitalize
names like Martin van Buren, Sean O'Leary, Hendryk van der Meer,
Louise Smith-Jones, or Francis McDaniels.

Each of those will be improperly capitalized (using StrConv() ) to:
Martin Van Buren, Sean O'leary, Hendryk Van Der Meer, Louise
Smith-jones, and Francis Mcdaniels.

And then, some names can be capitalize in several ways.
For example, McDonald and Mcdonald are both correct, depending upon
the wishes of the named person.

It would be wise to use some method of checking for unusual
capitalization's before using StrConv().
I use a table of exception names. DLookUp the entered name and present
a message if the name is on the list, offering the alternative
spelling before changing it. Additional names can then be added to the
table, when needed.
 

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

Top