initial capital format

L

LCalaway

Hi all
Several folks worked on a project with some capitalizing everything and
others using upper case for the first letter of a name and lowercase letters
for the rest.

I am now searching for a format procedure or a module that will help me, in
a report, capitalize the first letter of each word and display the other
letters in lowercase. I want "Smith" not "SMITH."

Thank you
L Calaway
 
F

fredg

Hi all
Several folks worked on a project with some capitalizing everything and
others using upper case for the first letter of a name and lowercase letters
for the rest.

I am now searching for a format procedure or a module that will help me, in
a report, capitalize the first letter of each word and display the other
letters in lowercase. I want "Smith" not "SMITH."

Thank you
L Calaway

Add an unbound text control to the report.
Set it's congtrol source to:
= StrConv([FieldName],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 capitalization 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.
 
J

John Spencer

You can use the following, which is a bit more complex, but will only change the
capitalization when Fieldname is all caps. It will keep the capitalization when
the field is mixed case.

=IIF(StrComp(UCase([FieldName]),[FieldName],0)=0,StrConv([FieldName],3),[FieldName])

Not fully tested if fieldname is null.
Hi all
Several folks worked on a project with some capitalizing everything and
others using upper case for the first letter of a name and lowercase letters
for the rest.

I am now searching for a format procedure or a module that will help me, in
a report, capitalize the first letter of each word and display the other
letters in lowercase. I want "Smith" not "SMITH."

Thank you
L Calaway

Add an unbound text control to the report.
Set it's congtrol source to:
= StrConv([FieldName],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 capitalization 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.
 

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