Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Michelle Craig Michelle Craig is offline
external usenet poster
 
Posts: 3
Default Word "If-then-else" Field

Hi,

I'm trying to create a mail merge document that will display information for
a particular academic area based on three criteria that are in the data
source. One is degree (ADEG1), one is College (ACOL1) and one is Major Code
(MAJ1_CODE). I have been trying to nest the IF statements to look at all
three fields, but I can only get it to the point where it will look at two of
the fields. If anyone has made an IF work with more than two fields, would
you let me know? The code that works is below. Where I'm getting stuck is
adding in the third field. No matter what I've tried, it throws a field
calculation error when I try to run the merge. I'd really appreciate any help
you might be able to provide.

{ IF { = AND ( { COMPARE {MERGEFIELD ACOL1="Graduate School of Management"
}, {COMPARE {MERGEFIELD AMAJ1_CODE } = "BU-MBA" } ) } = 1 "Contact Name" "" }

If you know of a different way to nest IF statements and can provide an
example, that would be fantastic. I've tried looking on line and in MS Online
help, but this is the best I can locate.

Thanks so much,
--
Michelle Craig
Kent State University

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Word "If-then-else" Field


I think you need:

{ IF "{ MERGEFIELD ACOL1 }" = "Graduate School of Management"
"{ IF "{ MERGEFIELD AMAJ1_CODE }" = "BU-MBA"
"Contact Name" "" } "" }

You can probably ditch the "" around the { MERGEFIELD } fields.

Peter Jamieson

"Michelle Craig" wrote in message
...
Hi,

I'm trying to create a mail merge document that will display information
for
a particular academic area based on three criteria that are in the data
source. One is degree (ADEG1), one is College (ACOL1) and one is Major
Code
(MAJ1_CODE). I have been trying to nest the IF statements to look at all
three fields, but I can only get it to the point where it will look at two
of
the fields. If anyone has made an IF work with more than two fields, would
you let me know? The code that works is below. Where I'm getting stuck is
adding in the third field. No matter what I've tried, it throws a field
calculation error when I try to run the merge. I'd really appreciate any
help
you might be able to provide.

{ IF { = AND ( { COMPARE {MERGEFIELD ACOL1="Graduate School of Management"
}, {COMPARE {MERGEFIELD AMAJ1_CODE } = "BU-MBA" } ) } = 1 "Contact Name"
"" }

If you know of a different way to nest IF statements and can provide an
example, that would be fantastic. I've tried looking on line and in MS
Online
help, but this is the best I can locate.

Thanks so much,
--
Michelle Craig
Kent State University



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Michelle Craig Michelle Craig is offline
external usenet poster
 
Posts: 3
Default Word "If-then-else" Field

Peter,

Thanks so much for pointing me in the right direction. I was able to get it
to work with three nested IFs. It worked great. The code ended up as follows:

{ IF "{ MERGEFIELD ACOL1 }" = "Graduate School of Management"
"{ IF "{ MERGEFIELD AMAJ1_CODE }" = "BU-MBA"
"{IF "{MERGEFIELD ADEG1}" = "MBA" "Contact Name" } "" } "" }
--
Michelle Craig
Kent State University


"Peter Jamieson" wrote:


I think you need:

{ IF "{ MERGEFIELD ACOL1 }" = "Graduate School of Management"
"{ IF "{ MERGEFIELD AMAJ1_CODE }" = "BU-MBA"
"Contact Name" "" } "" }

You can probably ditch the "" around the { MERGEFIELD } fields.

Peter Jamieson

"Michelle Craig" wrote in message
...
Hi,

I'm trying to create a mail merge document that will display information
for
a particular academic area based on three criteria that are in the data
source. One is degree (ADEG1), one is College (ACOL1) and one is Major
Code
(MAJ1_CODE). I have been trying to nest the IF statements to look at all
three fields, but I can only get it to the point where it will look at two
of
the fields. If anyone has made an IF work with more than two fields, would
you let me know? The code that works is below. Where I'm getting stuck is
adding in the third field. No matter what I've tried, it throws a field
calculation error when I try to run the merge. I'd really appreciate any
help
you might be able to provide.

{ IF { = AND ( { COMPARE {MERGEFIELD ACOL1="Graduate School of Management"
}, {COMPARE {MERGEFIELD AMAJ1_CODE } = "BU-MBA" } ) } = 1 "Contact Name"
"" }

If you know of a different way to nest IF statements and can provide an
example, that would be fantastic. I've tried looking on line and in MS
Online
help, but this is the best I can locate.

Thanks so much,
--
Michelle Craig
Kent State University




Reply
Thread Tools
Display Modes

Posting Rules

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What does "char" "char1" "char2" mean in styles in Word? Li Microsoft Word Help 2 September 5th 07 03:22 PM
"Print current page" should have a "+n pages" field. rawahoho Microsoft Word Help 5 November 16th 06 03:26 PM
"h" and "t" allowed in form Number field Lori S Microsoft Word Help 1 October 17th 06 10:49 PM
New field for Word: {SCREENTIP "DisplayText" "TipText"} DQC from Prescott AZ Microsoft Word Help 1 March 17th 06 11:29 PM
In a Fillin Field, how do I get "th" or "rd" to be in superscript? Ann @ Staples Microsoft Word Help 1 December 22nd 05 11:09 AM


All times are GMT +1. The time now is 06:55 AM.

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"