Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Jessica B.[_2_] Jessica B.[_2_] is offline
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
magicdds magicdds is offline
external usenet poster
 
Posts: 15
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP on news.microsoft.com Doug Robbins - Word MVP on news.microsoft.com is offline
external usenet poster
 
Posts: 407
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default 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


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:28 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"