Not merging one field if another is blank

A

Alvin Mast

I'm doing a merge using an Access contact file. The user is allowed up to 7
telephone numbers, each with 3 fields: FieldName, AreaCode, Number.

I want to not merge any of the 3 fields if Number is blank. I tried
inserting an IF statement but it's not working.

How can I do this?
 
D

Doug Robbins - Word MVP

It would help point out why it is not working if you had posted the field
construction that you had tried and also what "it's not working." means in
terms of the result that you do get.

To start with, the field delimiters { } must be entered using Ctrl+F9. They
cannot be entered using the keys in the row above the Enter Key (on a US
Keyboard)

{ IF { MERGEFIELD Number } <> "" "{ MERGEFIELD FieldName} { MERGEFIELD
AreaCode } { MERGEFIELD Number}" "" }



--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
A

Alvin Mast

Doug, thanks a big bunch for the solution. The only difference between you
"IF" and mine was that I did not have quotes around the 3 fields after the <>.

{IF ( MERGEFIELD "Private" } <> " " "{ MERGEFIELD "PrivField' } { MERGEFIELD
"PrivAreaCode } { MERGEFIELD "Private" }"}

I apologize for being so vague. By "not working" I meant that the
PrivAreaCode was still printing. I tried to copy and paste the instruction,
but the MERGEFIELDs were replace by values.

al
 

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