Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
2 ifs in one if...than...else
I need some help making a code that has to variables in the if field.
If regionnbr is 110000 and dealernbr is 100 than return statement1 if not return statment2 and other merge fields |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
2 ifs in one if...than...else
Try this:
{If Mergefield {regionnbr} = 110000 "{If Mergefield {dealernbr} = 100 "statement1" "statement2"} "" } Hope this helps. Mark "Jessica B." wrote: I need some help making a code that has to variables in the if field. If regionnbr is 110000 and dealernbr is 100 than return statement1 if not return statment2 and other merge fields |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
2 ifs in one if...than...else
{ IF { MERGEFIELD regionnbr } = 110000 { IF { MERGEFIELD dealernbr } = 100
"Statement1" "Statement2 and other mergefields" } "Statement2 and other mergefields" } You must use Ctrl+F9 for each pair of field delimiters { } and you use Alt+F9 to toggle off their display. -- 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, originally posted via msnews.microsoft.com "Jessica B." wrote in message ... I need some help making a code that has to variables in the if field. If regionnbr is 110000 and dealernbr is 100 than return statement1 if not return statment2 and other merge fields |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
2 ifs in one if...than...else
Try
{ IF { ={ COMPARE regionnbr = 110000 }+{ COMPARE dealernbr = 100 } } = 2 "statement1" "statement2 and other merge fields" } where all the {} are the special field code braces you can insert using ctrl-F9, and xyz is e.g. { MERGEFIELD xyz } This is one way to avoid duplicating all the "statement2 and other merge fields" Peter Jamieson http://tips.pjmsn.me.uk Jessica B. wrote: I need some help making a code that has to variables in the if field. If regionnbr is 110000 and dealernbr is 100 than return statement1 if not return statment2 and other merge fields |
#5
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
2 ifs in one if...than...else
Hi Jessica,
You could code a single IF test as: {IF{=(«regionnbr»= 110000)*(«rdealernbr»= 100)}= 1 "statement1" "statment2 and other merge fields"} -- Cheers macropod [MVP - Microsoft Word] "Jessica B." wrote in message ... I need some help making a code that has to variables in the if field. If regionnbr is 110000 and dealernbr is 100 than return statement1 if not return statment2 and other merge fields |