Quite correct. I created a little function long ago that does a bit better
job. Please ignore the sloppy coding - I created this for Access 95! But
if it ain't broke, don't fix it. <s>
--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
==================================
Public Function ProperCase(strIn As String) As String
' This function works similar to StrConv vbProperCase,
' but it also recognizes *any* intervening punctuation
' and the common last name prefixes O', Mc, and Mac
Dim strWork As String, intP As Integer, intL As Integer, intCap As Integer
Dim strThisChar As String
' First letter is always cap
intCap = True
' Make a lower case copy of the string
strWork = LCase(strIn)
intP = 1
intL = Len(strWork)
Do While intP <= intL
strThisChar = Mid(strWork, intP, 1)
If intCap Then
Mid(strWork, intP, 1) = UCase(strThisChar)
' Special test for beginning "MAC", "MC", "O'", or "Van"
If Mid(strWork, intP, 3) = "Mac" Then
intP = intP + 2
ElseIf Mid(strWork, intP, 2) = "Mc" Then
intP = intP + 1
ElseIf Mid(strWork, intP, 2) = "O'" Then
intP = intP + 1
ElseIf Mid(strWork, intP, 3) = "Van" Then
intP = intP + 2
Else
intCap = False
End If
End If
' If this character is not a letter...
If Not (strThisChar Like "[a-z]") Then
' .. unless it's a single quote
If (strThisChar = "'") Or (Asc(strThisChar) = 146) Then
' Then next character should not be capitalized
intCap = False
Else
' Otherwise next character should be capitalized
intCap = True
End If
End If
intP = intP + 1
Loop
ProperCase = strWork
End Function
================================