Jump to content

formatting phone numbers


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

Recommended Posts

You can use three fields, the data entry field=Phone[text], and 2 calculation fields.

PhoneToNum[calc]=NumToText(Abs(TextToNum(Phone)*10000000))

[This converts the phone number to just a number, ignoring any other format or text the user may enter - then back to text with just the numerics]

PhoneCalc[calc]="("& Middle(PhoneToNum,1,3) &")"& Middle(PhoneToNum,4,3) &"-"& Middle(PhoneToNum,7,4)

Place the Phone field on the layout and make it non-printing, then place the PhoneCalc field over it and make the color white so the Phone field does not show through it. Make sure the Field format for PhoneCalc does not allow entry or is not in the tab order. If browse mode, when you tab or click into the overlayed fields, it will enter the Phone field, enter the number in any format, and when you tab or click out of the field, the reformatted phone number will appear and will print.

Link to comment
Share on other sites

This topic is 8449 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.