Phone number format on merged document

C

Celia

When I merge from an access database to a word document,
the phone numbers end up as a string of numbers with no
hyphens. In access I have a format set up and working
fine, but it does not translate to the merged document.

I've waded through lots of help articles about field
codes, but none of the ones listed are helpful for this
problem.

Please tell me I don't have to go through 25 directory
pages putting hyphens in the phone numbers!
Celia
 
P

Peter Jamieson

In access I have a format set up and working
fine, but it does not translate to the merged document.

Unfortunately, this is correct - you just see the raw string of digits.
Please tell me I don't have to go through 25 directory
pages putting hyphens in the phone numbers!

Since you've had a look around at the help articles, I assume that using a
Word format switch such as

{ MERGEFIELD mynumber \#"(000}'-'000'-'0000" }

(or whatever similar format is in use where you, or at least your phone
numbers, are) isn't enough.

However, since the input/display masks in Access are usually fairly simple,
I would hope that you could use the alternative approach of using a function
in an Access query to construct the correct string. For example, if all the
numbers are ten-digit numbers and "(000)-000-0000" is the format you need,
you should be able to use either a format function in Access or a function
such as

'(' & Left(CStr(mynumber),3) & ')-' & Mid(CStr(mynumber),4,3) & '-' &
Mid(CStr(mynumber),7)) AS myformattednumber

in an Access Query's SQL. Or maybe something slightly more reliable if the
numbers can be missing leading zeros:

Right('0000000000' & CStr(Trim(mynumber)),10) As mynum,
'(' & Left(mynum,3) & ')-' & Mid(mynum,4,3) & '-' & Mid(mynum,7)) AS
myformattednumber

If you need further help on this, can you please tell us
a. what the format of the numbers actually in your database is (not the
numbers as displayed, which might for example be missing leading zeros, but
the numbers actually stored)
b. what format(s) you need as output.
c. what help you need, if any, with setting up a suitable Access query.

It's up to you to decide which course is actually easier - getting some sort
of mask to work or fixing all those numbers.
 

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