Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 7373 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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?

Posted

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 )))

Posted

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).

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.