Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail Merge Phone Number Formatting

Status
Not open for further replies.

WillYum

Programmer
May 21, 2001
31
US
Hi there. I am having trouble outputting mail merge formatting.

This thread: thread68-235292 pretty much answered all of my questions and helped out great!
The function:
Code:
WorkPhoneP: "(" & Left([WorkPhone],3) & ") " & Mid([WorkPhone],4,3) & "-" & Right([WorkPhone],4)
works great.

Except one thing.

For some records this value is empty. How do I prevent Access from displaying "() -" (sans quotes) for null fields in the query?

I would let them stay but that would mean when it was merged with an empty phone number it would show () - for the phone field in the mail merged document.

It seems like it's just a matter of displaying an empty value "" or not applying this function to null values, I just can't figure how to code it.

Thanks. - William ~^~ ~^~

~ W . I . L . L . Y . U . M ~
wOrLd WiDe WhAt?
 
Hi

Try

WorkPhoneP: IIF(Len(Trim(Nz([WorkPhone],""))) = 0," ","(" & Left([WorkPhone],3) & ") " & Mid([WorkPhone],4,3) & "-" & Right([WorkPhone],4))

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Perfect!

:)

Many Appreciations. - William ~^~ ~^~

~ W . I . L . L . Y . U . M ~
wOrLd WiDe WhAt?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top