Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filemaker Formula

Status
Not open for further replies.

bv2000

Vendor
Nov 9, 2006
12
US
I have a field that looks for a telephone number from another table if the ID# matches. If it is a new client, how do I write a script to #1 - look to see if there is a match for that ID# and then automatically enter the phone number, and #2 if there isn't, then how do i enter a mask so the newly entered phone appears like (xxx)xxx-xxxx. When, FM definitions are set up, there is a choice to either have a look up or a formula. How do I do both?
 
Try this calc. for phone number to be formated (XXX) XXX-XXXX

Let(
Clean Phone = Filter(Home Phone;"0123456789");
Case(
Length(Clean Phone) = 10;
"(" & Left(Clean Phone;3) & ")" & " " &
Middle(Clean Phone;4;3) & "-" &
Right(Clean Phone;4);Home Phone)
)
 
Use a lookup based on the ID# relationship and put the above formula as auto-enter calc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top