First Letter Capital

J

Jim/Chris

This will capatize the first letter of every word in a form
Me![fieldname] = StrConv(Me![fieldname],3)

Full explanation

Returns a Variant (String) converted as specified.

Syntax

StrConv(string, conversion, LCID)

The StrConv function syntax has these named arguments:

Part Description
string Required. String expression to be converted.
conversion Required. Integer. The sum of values specifying
the type of conversion to perform.
LCID Optional. The LocaleID, if different than the system
LocaleID. (The system LocaleID is the default.)



Settings

The conversion argument settings are:

Constant Value Description
vbUpperCase 1 Converts the string to uppercase
characters.
vbLowerCase 2 Converts the string to lowercase
characters.
vbProperCase 3 Converts the first letter of every
word in string to uppercase.
vbWide* 4* Converts narrow (single-byte)
characters in string to wide (double-byte) characters.
vbNarrow* 8* Converts wide (double-byte)
characters in string to narrow (single-byte) characters.
vbKatakana** 16** Converts Hiragana characters in string
to Katakana characters.
vbHiragana** 32** Converts Katakana characters in string
to Hiragana characters.
vbUnicode 64 Converts the string to Unicode using
the default code page of the system. (Not available on the
Macintosh.)
vbFromUnicode 128 Converts the string from Unicode
to the default code page of the system. (Not available on
the Macintosh.)
Jim
 
B

Brendan Reynolds \(MVP\)

Consider the following, all of which are wrong.

? strconv("mount mckinley",vbProperCase)
Mount Mckinley
? strconv("mcphereson strut",vbpropercase)
Mcphereson Strut
? strconv("mcdonalds",vbProperCase)
Mcdonalds
? strconv("mcgrath-hill",vbpropercase)
Mcgrath-hill

A developer can *help* a user to enter correct data and avoid mistakes, but
we can not *force* the user to enter correct data and avoid mistakes. If you
cannot trust the user to enter data correctly, then data will not be entered
correctly. The only way to completely idiot-proof a database is not to allow
any idiots anywhere near it.

It never ceases to amaze me that many organisations will pay good money for
hardware and software but will not spend money to hire or train data entry
staff who actually know what the Shift key is for. Good data entry staff are
an extremely under-valued resource.

--
Brendan Reynolds (MVP)
(e-mail address removed)

Jim/Chris said:
This will capatize the first letter of every word in a form
Me![fieldname] = StrConv(Me![fieldname],3)

Full explanation

Returns a Variant (String) converted as specified.

Syntax

StrConv(string, conversion, LCID)

The StrConv function syntax has these named arguments:

Part Description
string Required. String expression to be converted.
conversion Required. Integer. The sum of values specifying
the type of conversion to perform.
LCID Optional. The LocaleID, if different than the system
LocaleID. (The system LocaleID is the default.)



Settings

The conversion argument settings are:

Constant Value Description
vbUpperCase 1 Converts the string to uppercase
characters.
vbLowerCase 2 Converts the string to lowercase
characters.
vbProperCase 3 Converts the first letter of every
word in string to uppercase.
vbWide* 4* Converts narrow (single-byte)
characters in string to wide (double-byte) characters.
vbNarrow* 8* Converts wide (double-byte)
characters in string to narrow (single-byte) characters.
vbKatakana** 16** Converts Hiragana characters in string
to Katakana characters.
vbHiragana** 32** Converts Katakana characters in string
to Hiragana characters.
vbUnicode 64 Converts the string to Unicode using
the default code page of the system. (Not available on the
Macintosh.)
vbFromUnicode 128 Converts the string from Unicode
to the default code page of the system. (Not available on
the Macintosh.)
Jim
-----Original Message-----

How do I get the first letter of an entry to be in capital. We all know we
cannot count on the user to enter the data correctly.

Greg
.
 
J

Jim/Chris

Excellently put Brendan. Unfortuantely I am with The City
and Idiot Proofing my database to the best of my ability is
required but you are right organizations should concentrate
on quality of employees.

Jim
-----Original Message-----
Consider the following, all of which are wrong.

? strconv("mount mckinley",vbProperCase)
Mount Mckinley
? strconv("mcphereson strut",vbpropercase)
Mcphereson Strut
? strconv("mcdonalds",vbProperCase)
Mcdonalds
? strconv("mcgrath-hill",vbpropercase)
Mcgrath-hill

A developer can *help* a user to enter correct data and avoid mistakes, but
we can not *force* the user to enter correct data and avoid mistakes. If you
cannot trust the user to enter data correctly, then data will not be entered
correctly. The only way to completely idiot-proof a database is not to allow
any idiots anywhere near it.

It never ceases to amaze me that many organisations will pay good money for
hardware and software but will not spend money to hire or train data entry
staff who actually know what the Shift key is for. Good data entry staff are
an extremely under-valued resource.

--
Brendan Reynolds (MVP)
(e-mail address removed)

This will capatize the first letter of every word in a form
Me![fieldname] = StrConv(Me![fieldname],3)

Full explanation

Returns a Variant (String) converted as specified.

Syntax

StrConv(string, conversion, LCID)

The StrConv function syntax has these named arguments:

Part Description
string Required. String expression to be converted.
conversion Required. Integer. The sum of values specifying
the type of conversion to perform.
LCID Optional. The LocaleID, if different than the system
LocaleID. (The system LocaleID is the default.)



Settings

The conversion argument settings are:

Constant Value Description
vbUpperCase 1 Converts the string to uppercase
characters.
vbLowerCase 2 Converts the string to lowercase
characters.
vbProperCase 3 Converts the first letter of every
word in string to uppercase.
vbWide* 4* Converts narrow (single-byte)
characters in string to wide (double-byte) characters.
vbNarrow* 8* Converts wide (double-byte)
characters in string to narrow (single-byte) characters.
vbKatakana** 16** Converts Hiragana characters in string
to Katakana characters.
vbHiragana** 32** Converts Katakana characters in string
to Hiragana characters.
vbUnicode 64 Converts the string to Unicode using
the default code page of the system. (Not available on the
Macintosh.)
vbFromUnicode 128 Converts the string from Unicode
to the default code page of the system. (Not available on
the Macintosh.)
Jim
-----Original Message-----

How do I get the first letter of an entry to be in capital. We all know we
cannot count on the user to enter the data correctly.

Greg
.


.
 

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