By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,461 Members | 2,184 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,461 IT Pros & Developers. It's quick & easy.

Capitalizing first letter of each work

P: n/a
Hi all,

How do you capitalize the first letter of each word in a field. I can format
the field to UPPER case the last name of a person, but I can't UPPER case
just the first letter of each name. tia

Dwight
Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
This link should help you - http://www.mvps.org/access/strings/str0005.htm

On Sun, 8 Aug 2004 01:40:40 -0500, "Dwight" <ds******@comcast.net> wrote:
Hi all,

How do you capitalize the first letter of each word in a field. I can format
the field to UPPER case the last name of a person, but I can't UPPER case
just the first letter of each name. tia

Dwight


Nov 13 '05 #2

P: n/a
"Dwight" <ds******@comcast.net> wrote in message news:<dJ********************@comcast.com>...
Hi all,

How do you capitalize the first letter of each word in a field. I can format
the field to UPPER case the last name of a person, but I can't UPPER case
just the first letter of each name. tia

Dwight


Try: StrConv([MyField], vbProperCase)

Note that StrConv requires a string so use IIf or some other means to exclude Nulls.

James A. Fortune
Nov 13 '05 #3

P: n/a
http://groups.google.com/groups?q=ca...com.com&rnum=2
"Dwight" <ds******@comcast.net> wrote in message
news:dJ********************@comcast.com...
Hi all,

How do you capitalize the first letter of each word in a field. I can format the field to UPPER case the last name of a person, but I can't UPPER case
just the first letter of each name. tia

Dwight

Nov 13 '05 #4

P: n/a
James Fortune wrote:
"Dwight" <ds******@comcast.net> wrote in message news:<dJ********************@comcast.com>...
Hi all,

How do you capitalize the first letter of each word in a field. I can format
the field to UPPER case the last name of a person, but I can't UPPER case
just the first letter of each name. tia

Dwight

Try: StrConv([MyField], vbProperCase)

Note that StrConv requires a string so use IIf or some other means to exclude Nulls.

James A. Fortune


A good way would be to write a function to wrap it, e.g.

Function ProperCase(pvarText As Variant) As Variant
If IsNull(pvarText) Then
ProperCase = Null
Else
ProperCase = StrConv(pvarText, vbProperCase)
End If
End Function

That way, if null is passed in then null is returned, rather than a zero
length string, which may upset some table that doesn't allow zero length
strings.

--
Error reading sig - A)bort R)etry I)nfluence with large hammer
Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.