Capitalization

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i can capitalize a word or set of words with
StrConv([ControlName],vbProperCase).
However names like O'Connor are imporperly capitalized.
An obvious solution is a reference table of names which might be subject to
this problem.
Can anyone direct me to such a table? I did this once and it is really
laborious to build, and usually incomplete anyway!
And yes I would allow people to override and to add new entries...

Thanks for any help!
 
Ron

Have you tried Google.com or the mvps.org website?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Nope, but a good idea!

Jeff Boyce said:
Ron

Have you tried Google.com or the mvps.org website?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Ron Carr said:
i can capitalize a word or set of words with
StrConv([ControlName],vbProperCase).
However names like O'Connor are imporperly capitalized.
An obvious solution is a reference table of names which might be subject
to
this problem.
Can anyone direct me to such a table? I did this once and it is really
laborious to build, and usually incomplete anyway!
And yes I would allow people to override and to add new entries...

Thanks for any help!
 
i can capitalize a word or set of words with
StrConv([ControlName],vbProperCase).
However names like O'Connor are imporperly capitalized.
An obvious solution is a reference table of names which might be subject to
this problem.
Can anyone direct me to such a table? I did this once and it is really
laborious to build, and usually incomplete anyway!
And yes I would allow people to override and to add new entries...

Thanks for any help!

See if this helps.
Watch out for line wrap on the longer lines.

Make a new table.
Field: [ID] AutoNumber Indexed No Duplicates
Field: [ExceptName] Text
TableName: tblExceptions

Enter as many known name exceptions as you can, i.e. McDonald,
O'Brien, van den Steen, Smith-Jones, etc.

====
Paste this function into a new module.

Public Function ConvExceptions(StringIn As String) As String

' Will find exceptions to Proper Case capitalization of names.
On Error Resume Next

If DCount("*", "tblExceptions", "[ExceptName] = " & Chr(34) & StringIn
& Chr(34) & "") > 0 Then
Dim intResponse As Integer
Dim strFind As String
strFind = DLookup("[ExceptName]", "tblExceptions", "[ExceptName] =
" & Chr(34) & StringIn & Chr(34) & "")

intResponse = MsgBox(strFind & vbCrLf & " is an exception name." &
vbCrLf & " Accept the above capitalization? Y/N ?", vbYesNo,
"Exception found!")

If intResponse = vbYes Then
ConvExceptions = strFind
Exit Function
End If
End If

ConvExceptions = StrConv(StringIn, 3)

End Function
======

Use it in a Control's AfterUpdate event:

If Not IsNull([ThisField]) Then
[ThisField] = ConvExceptions([ThisField])
End If


Add new names to the exceptions table as they occur.

Also remember that there are multiple correct capitalizations of
names, O'Connor and O'connor are both correct, depending upon the
individual's choice, and some words can be capitalized or not,
depending upon usage i.e. "The city's main street is Main Street."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top