2 ifs in one if...than...else

J

Jessica B.

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
 
M

magicdds

Try this:

{If Mergefield {regionnbr} = 110000 "{If Mergefield {dealernbr} = 100
"statement1" "statement2"} "" }

Hope this helps.
Mark
 
D

Doug Robbins - Word MVP on news.microsoft.com

{ 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
 
P

Peter Jamieson

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
 
M

macropod

Hi Jessica,

You could code a single IF test as:
{IF{=(«regionnbr»= 110000)*(«rdealernbr»= 100)}= 1 "statement1" "statment2 and other merge fields"}
 

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