Convert Name to "Proper" Format

K

Ken Hudson

Hi,

I have a table named Comp with a field called EmpName. The data in this
field has all upper case names and I want to convert them to "proper" formats
with upper and lower case letters.

I found the StrConv function and assume that I need to use it in a module. I
can program some in Excel VBA, but haven't developed enough skills to know
how to do this in Access.

I assume that this code would not be very long and that someone might be
able to show me how to write this module, please. I don't care about not
being able to handle the McCoy and O'Shea- type names.

TIA.
 
J

Jeff Boyce

Ken

Create a new query in design view.

Add the table. Add the field.

Add a new field, something like (untested aircode follows):

NewField: StrConv([EmpName],3)

This should generate the Proper Case version of [EmpName]. When this is
working as it should, you could convert your query to an update query to
permanently change [EmpName] ... WARNING! You are about to modify your
database. Make a backup first!

Or you could make your life easier and just use the query, rather than
permanently changing your data...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
A

Armen Stein

Hi,

I have a table named Comp with a field called EmpName. The data in this
field has all upper case names and I want to convert them to "proper" formats
with upper and lower case letters.

I found the StrConv function and assume that I need to use it in a module. I
can program some in Excel VBA, but haven't developed enough skills to know
how to do this in Access.

I assume that this code would not be very long and that someone might be
able to show me how to write this module, please. I don't care about not
being able to handle the McCoy and O'Shea- type names.

TIA.

Take a backup of your database first.

You can use an Update query for this, with no module necessary.

In the Update To field under the EmpName field, specify
StrConv([EmpName], 3)


Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 
K

Ken Hudson

Hi Jeff,

Thanks. That worked. I had tried that before posting but I must have erred
in my formatting.

--
Ken Hudson


Jeff Boyce said:
Ken

Create a new query in design view.

Add the table. Add the field.

Add a new field, something like (untested aircode follows):

NewField: StrConv([EmpName],3)

This should generate the Proper Case version of [EmpName]. When this is
working as it should, you could convert your query to an update query to
permanently change [EmpName] ... WARNING! You are about to modify your
database. Make a backup first!

Or you could make your life easier and just use the query, rather than
permanently changing your data...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Ken Hudson said:
Hi,

I have a table named Comp with a field called EmpName. The data in this
field has all upper case names and I want to convert them to "proper"
formats
with upper and lower case letters.

I found the StrConv function and assume that I need to use it in a module.
I
can program some in Excel VBA, but haven't developed enough skills to know
how to do this in Access.

I assume that this code would not be very long and that someone might be
able to show me how to write this module, please. I don't care about not
being able to handle the McCoy and O'Shea- type names.

TIA.
 

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