Jump to content
Server Maintenance This Week. ×

Fields


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

Recommended Posts

quote:

Originally posted by crimpy:

How can I set a Phone # Field to add spaces or - between the prefix, and first three numbers?

You need to have two field: one for data entry and one for the appearance.

Let's say that you want to format a seven digit phone number with a dash between the third and fourth digit. The data input field is a text field called "Phone".

Create a text calculation field called "Phone_Formatted" and set it to

Left( Phone, 3 ) & "-" & Right( Phone, 4 )

This should work even if the user places the dash in themselves.

If you need to cover area codes, obviously your calc will be a bit more complicated, but you probably get the idea.

On the user interface side, place both the "Phone" and the "Phone_Formatted" fields in the same spot on the layout so that they cover each other. Bring the "Phone_Formatted" field to the front so that it is the one that is seen, but set its field formatting so that users can't enter the field. Set the "Phone" field so that users can enter the field. That way when the user clicks on the "Phone_Formatted" field, they actually enter the "Phone" field and can make their changes.

Chuck

Link to comment
Share on other sites

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