Thank you both for your input.
Fred- I think a list of exceptions would be best, I can only see a handful
of these...I look forward to your coding.
Add a new table to your database.
Add 2 fields.
1 [ID] Autonumber Indexed No duplicates
2 [ExceptName] Text Datatype 255 chrs
Name the table 'tblExceptions'
Copy and Paste the following code into a Module:
*** Watch out for word wrap on the longer lines. ***
Function ConvExceptionsInField(StrIn As String) As String
' Will find exceptions to Proper Case capitalization of names.
' In a multi-word string
On Error GoTo Err_Handler
Dim strWord As String
Dim intX As Integer
Dim intY As Integer
Dim strNewString As String
Dim intResponse As Integer
Dim strFind As String
StrIn = StrIn & " "
intX = InStr(1, StrIn, " ")
strWord = StrConv(Mid(StrIn, intY + 1, intX - 1), vbProperCase)
Do While intX <> 0
If DCount("*", "tblExceptions", "[ExceptName]= " & Chr(34) & strWord &
Chr(34) & "") > 0 Then
strFind = DLookup("[ExceptName]", "tblExceptions", "[ExceptName] =
" & Chr(34) & strWord & Chr(34) & "")
intResponse = MsgBox(strFind & vbCrLf & " is an exception name." &
vbCrLf & " Accept the above capitalization? Y/N ?", vbYesNo,
"Exception found!")
If intResponse = vbYes Then
strWord = strFind
End If
End If
strNewString = strNewString & strWord & " "
intY = intX + 1
intX = InStr(intY, StrIn, " ")
strWord = StrConv(Mid(StrIn, intY, intX - intY), vbProperCase)
Loop
ConvExceptionsInField = strNewString
Exit_this_Function:
Exit Function
Err_Handler:
Resume Next
End Function
===============
Then code the AfterUpdate event of the control (named Address in this
example) used for address entry on your form:
If Not IsNull([Address]) Then
[Address] = ConvExceptionsInField([Address])
End If
Then enter the exception names into the table as you come across them,
i.e. McDonald, US, IBM, O'Connor, etc.
As you enter addresses, if a word is found in the table, yow will get
a message asking whether to retain the entered capitalization or
change it. As you find a new words, add them to the table.