Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / February 2006

Tip: Looking for answers? Try searching our database.

Capitalization

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ron Carr - 28 Feb 2006 14:27 GMT
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!
Jeff Boyce - 28 Feb 2006 15:46 GMT
Ron

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

Regards

Jeff Boyce
Microsoft Office/Access MVP

>i can capitalize a word or set of words with
> StrConv([ControlName],vbProperCase).
[quoted text clipped - 7 lines]
>
> Thanks for any help!
Ron Carr - 28 Feb 2006 17:47 GMT
Nope, but a good idea!

> Ron
>
[quoted text clipped - 16 lines]
> >
> > Thanks for any help!
fredg - 28 Feb 2006 19:48 GMT
> i can capitalize a word or set of words with
> StrConv([ControlName],vbProperCase).
[quoted text clipped - 6 lines]
>
> 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."
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.