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 / November 2007

Tip: Looking for answers? Try searching our database.

How to convert a string to Proper Case

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark Anders - 01 Nov 2007 18:26 GMT
Hi!

My problem is how to convert a text to proper case for example  mARK anders
==> Mark Anders. It works with following function, but the field cannot be
edit:

Function Aa(strToChange As String) As String
   On Error Resume Next
   Aa = StrConv(strToChange, vbProperCase)
End Function

Using the function in a field, for example: =Aa(Name)

How can I use that function and keep the field editable?
Thanks in advance!

Have a Nice Day!
SteveM - 01 Nov 2007 18:43 GMT
Do the conversion in the AfterUpdate event of the control.

Steve
Signature

Steve McGuire
MCSD, MCAD, MCP

> Hi!
>
[quoted text clipped - 13 lines]
>
> Have a Nice Day!
Douglas J. Steele - 01 Nov 2007 22:05 GMT
Or in the BeforeUpdate event of the form.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> Do the conversion in the AfterUpdate event of the control.
>
[quoted text clipped - 19 lines]
>>
>> Have a Nice Day!
fredg - 01 Nov 2007 22:04 GMT
> Hi!
>
[quoted text clipped - 13 lines]
>
> Have a Nice Day!

Mark,
You asked, and Steve answered you, about Proper Case in fields.

A person's name is important to them.

It's not quite as simple a question as you asked, nor is the answer as
easy as Steve suggested.

Yes, using StrConv() after entering mARK anders  the name will be
converted properly to Mark Anders, but how should Access capitalize
names like Martin van Buren, Sean O'Leary, Hendryk van der Meer,
Louise Smith-Jones, or  Francis McDaniels.

Each of those will be improperly capitalized (using StrConv() ) to:
Martin Van Buren, Sean O'leary, Hendryk Van Der Meer, Louise
Smith-jones, and Francis Mcdaniels.

And then, some names can be capitalize in several ways.
For example, McDonald and Mcdonald are both correct, depending upon
the wishes of the named person.

It would be wise to use some method of checking for unusual
capitalization's before using StrConv().
I use a table of exception names. DLookUp the entered name and present
a message if the name is on the list, offering the alternative
spelling before changing it. Additional names can then be added to the
table, when needed.

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.