Newbies Dave Bivans Posted November 24, 2004 Newbies Posted November 24, 2004 I would like to permit the data entry of text , such as entering a telephone number, to not worry about the formatting but be formatted upon tabbing out of the field. For example, enter a phone number as 6107679560, and have the field format upon tabbing out of the field to (610) 767-9560. Over the years I have used other databases to do this with placeholders, but cannot find a way to do it in Filemaker 7. Any advice?
Søren Dyhr Posted November 24, 2004 Posted November 24, 2004 Although it needs a major overhaul to be more contemporay exploiting Evaluate( etc. could it be done like this: http://www.filemakerpros.com/FORMAT.sit --sd
transpower Posted November 24, 2004 Posted November 24, 2004 This problem has been discussed here many times. Here's the solution: Let(Phone = Filter(Phone;"0123456789");"(" & Left(Phone;3) & ")" & " " & Middle(Phone;4;3) & "-" & Middle(Phone;7;4)) If you want to trap the wrong number of digits: Let ( phoneHome = Filter ( phoneHome ; "0123456789" ) ; Choose (Length ( phoneHome ); "Too few digits"; /* 0 result */ "Too few digits"; /* 1 result */ "Too few digits"; /* 2 result */ "Too few digits"; /* 3 result */ "Too few digits"; /* 4 result */ "Too few digits"; /* 5 result */ "Too few digits"; /* 6 result */ "Too few digits"; /* 7 result */ "Too few digits"; /* 8 result */ "Too few digits"; /* 9 result */ "(" & Left ( phoneHome ; 3) & ")" & " " & Middle ( phoneHome ;4 ;3 ) & "-" & Middle ( phoneHome ; 7 ; 4 )))
Ender Posted November 24, 2004 Posted November 24, 2004 If you want to trap the wrong number of digits: Let ( phoneHome = Filter ( phoneHome ; "0123456789" ) ; Choose (Length ( phoneHome ); "Too few digits"; /* 0 result */ "Too few digits"; /* 1 result */ "Too few digits"; /* 2 result */ "Too few digits"; /* 3 result */ "Too few digits"; /* 4 result */ "Too few digits"; /* 5 result */ "Too few digits"; /* 6 result */ "Too few digits"; /* 7 result */ "Too few digits"; /* 8 result */ "Too few digits"; /* 9 result */ "(" & Left ( phoneHome ; 3) & ")" & " " & Middle ( phoneHome ;4 ;3 ) & "-" & Middle ( phoneHome ; 7 ; 4 ))) Probably better to leave the existing number in place and change the color rather than use "Too few digits". It makes it easier for the user to correct it. Here's a nice custom function that does this: http://www.briandunning.com/filemaker-custom-functions/detail.php?fn_id=41 If you don't have Developer, you can use the text of this function in a regular calc (with slight modification.) This is nice because it also handles numbers preceeded by a 1, and extensions after the number (x1234).
Recommended Posts
This topic is 7373 days old. Please don't post here. Open a new topic instead.
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