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