A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Custom Formats



 
 
Thread Tools Display Modes
  #1  
Old May 27th, 2005, 07:58 PM
bibby bibby is offline
Member
 
First recorded activity by OfficeFrustration: May 2005
Posts: 1
Question Custom Formats

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
  #2  
Old May 27th, 2005, 10:54 PM
Rick Brandt
external usenet poster
 
Posts: n/a
Default

bibby wrote:
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


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"

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


  #3  
Old May 28th, 2005, 02:49 AM
John Vinson
external usenet poster
 
Posts: n/a
Default

On Fri, 27 May 2005 18:58:19 +0000, bibby
wrote:


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]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Formats Amanda Cooper General Discussion 2 May 11th, 2005 07:27 PM
Custom Number Formats and system Josh O. Worksheet Functions 3 August 27th, 2004 01:49 AM
unknown formats being applied Biff General Discussion 2 July 12th, 2004 07:48 PM
How do you format custom fields designed for custom contact forms? Debalan Contacts 4 May 19th, 2004 11:54 PM
Custom # formats Keyur Worksheet Functions 1 February 13th, 2004 02:41 PM


All times are GMT +1. The time now is 07:54 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.