Format Existing Data in a Cell Range

G

Guest

I have a colum of phone numbers with area code in this form "8005551212" I want to format them to change to this "(800) 555-1212. Any Help
 
F

fredg

Rick said:
I have a colum of phone numbers with area code in this form "8005551212"
I want to format them to change to this "(800) 555-1212. Any Help

Rick,
Permanently?

An Update query will do that.

Update YourTable Set YourTable.PhoneField = "(" & left([PhoneField],3) &
") " & Mid([PhoneField],4,3) & "-" & Right([PhoneField],4)

This assumes each record has a complete 10 digit number.
You might want to set criteria to check that.

Substitute your actual Table nd Field names.
 
E

Ed Warren

If you want to format them for display in a form and/or report, then go to
the table design and for that field
apply an input mask:

Telephone Number (!\(999") "000\-0000;;)

Now on all NEW forms you will see the format (999) 888-7777 but the field in
the database will have 9998887777

for reports you can use a similar format to display the field as a telephone
number.

Hope this helps.

Ed Warren

Rick said:
I have a colum of phone numbers with area code in this form "8005551212" I
want to format them to change to this "(800) 555-1212. Any Help
 
R

Rolls

See help for the topic: input mask. Tele # is already defined. You're not
changing the stored result, just the view of the stored data.
You will only have to type in the number itself, the form supplies the
punctuation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top