Quote:
>Hi,
>Is it possible to validate the entry of phone numbers
>such as "555 777 9999" so that there are the spaces
>in between and all 10 characters are entered?
>--
>Thanks,
>Cesar A. Iriarte
>Systems Director
Yes, there is a way. Assuming the field name is tele, you must enter in a text
field and then the following convoluted formula:
Length(tele) = 12 and (100*TextToNum(Middle(tele, 1, 1)) +
10*TextToNum(Middle(tele, 2, 1)) + TextToNum(Middle(tele, 3, 1)) =
TextToNum(Middle(tele, 1, 3))) and Middle(tele, 4, 1) = " " and
(100*TextToNum(Middle(tele, 5, 1)) + 10*TextToNum(Middle(tele, 6, 1)) +
TextToNum(Middle(tele, 7, 1)) = TextToNum(Middle(tele, 5, 3))) and Middle(tele,
8, 1) = " " and (1000*TextToNum(Middle(tele, 9, 1)) +
100*TextToNum(Middle(tele, 10, 1)) + 10*TextToNum(Middle(tele, 11, 1)) +
TextToNum(Middle(tele, 12, 1)) = TextToNum(Middle(tele, 9, 4)))
You have to do it this way because FileMaker can not distinguish that alpha
numbers can not be numeric when using TextToNum very well, or else the formula
could be drastically shortened.
BTW, I am using FileMaker Pro 5.0 on the Mac, but I don't think that this is
going to matter that much.... :-)
Hope that this helps...
Bill
--------------
The box listed as the requirements: Windows95 or better
...so I bought a Macintosh.
(Remove nospam from email address)