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 / Database Design / May 2005

Tip: Looking for answers? Try searching our database.

Custom Formats

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bibby - 27 May 2005 19:58 GMT
Hi

Can anyone help me create a custom format for address fields - I would
like to be able to enter the address and it automatically change to
Sentence Case - easy for one word but can't seem to find the answer if
there are two or three words - such as  Apple Tree Road

Thanks

Bib

Signature

bibby

Rick Brandt - 27 May 2005 22:54 GMT
> Hi
>
[quoted text clipped - 6 lines]
>
> Bib

Thats' not sentence case, that's proper case and the strConv function can do
that for you.

strConv("apple tree road", vbProperCase) = "Apple Tree Road"

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

John Vinson - 28 May 2005 02:49 GMT
>Hi
>
>Can anyone help me create a custom format for address fields - I would
>like to be able to enter the address and it automatically change to
>Sentence Case - easy for one word but can't seem to find the answer if
>there are two or three words - such as  Apple Tree Road

A Format proprety isn't capable of doing this task; you need VBA code.
Note that Sentence Case will be WRONG for some addresses: I've got a
friend who lives on McCormick Lane for example!

Try putting the following code in the AfterUpdate event of a textbox
on the Form you're using to update this table. (Yes, you need a form;
no, table datasheets don't have any usable events):

Private Sub txtAddress_AfterUpdate()
' Only process entries which are all in lower case
If StrComp(Me!txtAddress, LCase(Me!txtAddress), vbBinary) = 0 Then
  Me!txtAddress = StrConv(Me!txtAddress, vbProperCase)
End If
End Sub

This will convert "apple tree road" to "Apple Tree Road", but will
leave "van Slyke Avenue" and "MAC Street" and "McClintock Lane" alone
since they're already in mixed case.

                 John W. Vinson[MVP]    
 
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.