Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    San Diego

    Unhappy Unanswered: Format Phone Number

    I am using FMP 7. I would like to format the phone number field to (666)777-8888. Basically, a user can enter Phone in this format OR as just numbers but as soon as they leave this field, the format should change to it.

    I only need the format to display BUT will only store the numbers in the table.

    Any idea or suggestion would be very helpful...

  2. #2
    Join Date
    Dec 2004

    Post Format Phone Numbers FM7

    Formatting anything is so much easier in FM7.

    1) First you want to filter the phone so that all you have left is the numeric digits.
    - Use Filter function in combination with the Left, Middle, and Right fucntions to grab the parts you need. Then add in the separators that you desire for display.

    2) Unlike previous versions of FileMaker, you can now auto-enter and validate data in a field at any time. Not just upon entry.

    Here is the commented calculation to use for a ten digit phone number. Remember - you can now comment all parts of FM7 including calculations. Comments are noted below by the C-style notation at the beginning and end of a line...example: /*comment*/ You could also use C-Plus style comments...Example: //comment (carriage return)

    You should be able to copy and paste this right into the calculation engine of FM7 and it should just work after you point it toward your own phone number field. If you have FM 7 Develolper you can also store it as a Custom Function for reuse later.

    Life is good!

    /*This calculation ONLY works with 10 digit phone numbers*/
    /*Remember to turn OFF the auto-entry feature for "Do not replace existing value for field"*/
    /*Unlike previous implementations of this feature, the data shown is EXACTLY the same as the data contained in teh field*/

    /*First you filter the phone number so that you are left with only the numeric digits*/

    /*Use the Left function to select only the first three digits out of the string of 10 digits*/

    Left (Filter (PhoneNumber; "1234567890"0:3)

    /*Add to your first three digits the hyphen or any other separator you wish*/

    & "-" &

    /*Use the Middle function to select only the middle three digits (the first three digits of the exchange) out of the string of 10 digits*/

    Middle (Filter (PhoneNumber; "1234567890");4;3)

    /*Add to your first three digits the hypen separartor*/

    & "-" &

    /*Use the Right function to select only the last four digits out of the string of 10 digits*/

    Right (Filter (PhoneNumber; "1234567890");4)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts