Revisit: string for capitalization

R

R. J. Diaz

I need to build on what was offered here in the original thread
(2/17-19/2004)

I need to convert from all caps to first letter caps for addresses,
hyphenated last names (Diaz-Smith), "Mc D" or "Mac D", multi-word street
addresses and PO Box street street addresses - in one step if possible.
Input masks don't seem to do the job across the board either, so I am
stuck with a lot of conversions. UCase(Left([FirstName],1)) &
LCase(Mid([FirstName],2)) works in the update query for single word
fields, but not for the others.

Is this possible in one step? One code line? Can/must I do each
separately?

Also, can I disable the caps lock key? I thought I did once, could but
couldn't find the code again.

Bob Diaz
 
D

Douglas J. Steele

Unfortunately, it's not possible in a single step.

In fact, it's quite difficult. For example, how are you going to handle the
fact that some people use MacDonald, while others use Macdonald?
 
R

rkc

R. J. Diaz said:
I need to build on what was offered here in the original thread
(2/17-19/2004)

I need to convert from all caps to first letter caps for addresses,
hyphenated last names (Diaz-Smith), "Mc D" or "Mac D", multi-word street
addresses and PO Box street street addresses - in one step if possible.
Input masks don't seem to do the job across the board either, so I am
stuck with a lot of conversions. UCase(Left([FirstName],1)) &

There's the StrConv function to handle some cases.
StrConv ("2120 SOUTH MICHIGAN AVE", vbProperCase)
results in
2120 South Michigan Ave.

Then there's the murky world of the regular expressions which can
be accessed via setting a reference to Microsoft VBScript Regular
Expressions.
 

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


Top