Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Proper case formatting?

Status
Not open for further replies.

straybullet

IS-IT--Management
Joined
Jun 5, 2003
Messages
593
Location
US
I am familiar with proper case formatting of text in Excel - however, in Access - it seems to be possible to either have all upper or lower case. Any suggestions?
 
You can check help for upper and lower case functions. In addition, if you only want the output to appear in upper case, put the > symbol in the format, in desing veiw, of the field.

An investment in knowledge always pays the best dividends.

by Benjamin Franklin
 
You can use the StrConv function to help control the case.

StrConv([YourField],vbProperCase)

This will convert your string to Title case. There are a few others. Here's a list from the help file in Access:

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.)

Should work for you. Let me know if not.

Patrick
 
Looks great - thank you - however, where should I use this?
 
You can use StrConv either in a formula for the control source of a text box

ControlSource: =StrConv([YourField],vbProperCase)

Or in the field of a query

YourField1: StrConv([YourField],vbProperCase)

I generally do formatting stuff like this at the form or report level, so as not to alter the data. If you change the format at the query level, you can run into some criteria problems later.

Good luck!

-Patrick

Nine times out of ten, the simplest solution is the best one.
 
Patrick’s is right, however I had problems using it in a query as he suggested. I found this to work in that scenario - YourField1: StrConv([YourField],3).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top