garrett Posted April 3, 2004 Posted April 3, 2004 I thought I heard FMP7 has the ability to automatically format a field to display a 13 digit number into a telephone number: 444444333 into (444) 444-3333. Does it work, or not? And how do you do it? Thanks!!! FileMaker Version: 7 Platform: Mac OS X Panther
OfficeMoMo Posted April 3, 2004 Posted April 3, 2004 The calculation field is utilized. c_telephone_number -> Calculation[text] = Substitute( telephone number ; ["-" ; ""] ; ["(" ; ""] ; [")" ; ""] ) Please download and check a sample. http://www.ne.jp/asahi/office/momo/upfiles/TelNo.ZIP Field c_telephone_number is used when searching a telephone number. Does it become helpful?
Newbies sarpedon Posted April 3, 2004 Newbies Posted April 3, 2004 In FMP7, you can use the Auto-Enter Calculated value and unchecked "Do not replace existing value of field (if any)". Put his formula in Specify for PhoneNumber [text] = "(" & Left(PhoneNumber;3) & ")" & Middle(PhoneNumber;4;3) & "-" & Right(PhoneNumber;4). Hope it helps
OfficeMoMo Posted April 3, 2004 Posted April 3, 2004 Thank you for follow. It seems that I understood on the contrary.
BruceJ Posted April 3, 2004 Posted April 3, 2004 Here's the formula I use to format the field: PHONE It works around users who may not enter all the numbers ro dashes, or leave off an area code, or leaves it as entered if they've entered an extension or something else: Case(Length(GetAsNumber( PHONE )) =10 ; "(" & Left(GetAsNumber( PHONE ); 3) & ") " & Middle(GetAsNumber( PHONE ); 4; 3) & "-" & Right(GetAsNumber( PHONE ); 4) ; Length(GetAsNumber( PHONE )) = 7; "(_______) " & Left(GetAsNumber( PHONE );3) & "-" & Right(GetAsNumber(phone); 4) ; PHONE ) I know I could have elimiated all the "GetAsNumber" by using the new "Filter" funtion, but my fingers are so used to typing in FMP6!
CobaltSky Posted April 3, 2004 Posted April 3, 2004 Actually Bruce, rather than use the GetAsNumber( ) function *or* the filter function seven times, you'd have been better off using FileMaker 7's new Let( ) function, as it will result in a calc expression that will execute far more efficiently. Eg: Let(X = GetAsNumber(Phone); Case(Length(X) =10 ; "(" & Left(X; 3) & ") " & Middle(X; 4; 3) & "-" & Right(X; 4); Length(X) = 7; "(___) " & Left(X);3) & "-" & Right(X; 4) ; Phone) )
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now