Format Existing Data in a Cell Range

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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
 
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.
 
Back
Top