Thread: Next If
View Single Post
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Chris Stammers Chris Stammers is offline
external usenet poster
 
Posts: 46
Default Next If

Thanks Peter. Apologies if I sound thick here - do I need to manually
construct that statement? It's just that it is my understanding that it won't
work if you do and the Next If statement doesn't have the facility to expand
or add in the way. Or am I totally missing the point?

Thanks.
Regards,
Chris

"Peter Jamieson" wrote:

Next if has some similar constraints to Skip if, e.g. you can't use
it in certain places such as text boxes.

However, the effect of next if is quite literal, i.e. if the condition
is true, Word will move to the next data source record and continue
processing the current "copy" of the Mail Merge Main Document. If the
condition is false, Word takes no action. So...

«Next If {FIELD1} 2» «Next If {FIELD2} 1» «Next If {FIELD1} B»


...if you're trying to use that to move 3 records if field1 is "C" and
field2 is 50, that should work. But if you're trying to move 1 record if
(field1 is not 2) or (field2 is not 1) or (field1 is not B) then you need to
put all the conditions inside a single Next if, which you could do using
e.g.

{ NEXTIF { ={ COMPARE { MERGEFIELD FIELD1 } 2 }+{ COMPARE { MERGEFIELD
FIELD2 } 1 }+{ COMPARE { MERGEFIELD FIELD1 } "B" } } 0 }

(Or something like that...)

Peter Jamieson
"Chris Stammers" wrote in message
...
Hello,

I am trying to set up a document and I need it to ignore a record with a
given criteria. I have used 'Skip If' before however this statement
generates
lots of error messages within our document generation system and I am
trying
to avoid that. How does 'Next If' differ from 'Skip If' and can I use more
than one 'Next If' statement in a document? I have set the document up
with
the following:

«Next If {FIELD1} 2» «Next If {FIELD2} 1» «Next If {FIELD1} B»

Do you foresee any problems with that? I am using Windows XP and Word 2000
from Office 2000 Premium

Thanks,
Chris