Solved

Access 2003: MailMerge Automation (question 3 - if..then..else...

Posted on 2012-04-09
3
246 Views
Last Modified: 2012-08-14
Hi EE,

Anybody knows how IF  THEN ELSE works as a field in a mail merge

Want to do:

If title = " " then N/A  ELSE title

i tried it.... and do not see it working


below is a sample document.....

tx so much, sandra

scrnMSPE-SHORT23doc.doc
0
Comment
Question by:mytfein
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 37825660
The IF dialogue won't accept fields for the True or the False parts. If you do use the diaolhgur, you will have to enter some text and change it into a field.

In general, set the display to show field codes rather than field results with the Alt+F9 toggle, so that <<Clerkship_Title_1>> looks like

{ MERGEFIELD Clerkship_Title_1 }. You can select the text and press Ctrl+F9 to field delimiters around the field so that the field is the only content of a surrounding field:

 { { MERGEFIELD Clerkship_Title_1 } }

You can then insert an IF and a condition

 { IF { MERGEFIELD Clerkship_Title_1 }  = "" }

and add some text:

{ IF { MERGEFIELD Clerkship_Title_1 }  = "" "Empty" "Text" }

or a field:

{ IF { MERGEFIELD Clerkship_Title_1 }  = "" "" "{  MERGEFIELD "Clerkship_Comments_1 }" }

Remember that if you now toggle back to show field results, the whole text will probably disappear until the merge is done or previewed.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 37825669
"If you do use the diaolhgur, you will have to enter some text and change it into a field."

should be :

"If you do use the dialogue, you will have to enter some text and overwrite it in the document with a field in the 'field code' view"
0
 

Author Comment

by:mytfein
ID: 37827940
Hi Graham,

tx so much for explaining about
              field code view,  and how to code If..else  in that view....


in your example:

{ IF { MERGEFIELD Clerkship_Title_1 }  = "" "" "{  MERGEFIELD "Clerkship_Comments_1 }" }

shour there be a commas between both spaces like this:

{ IF { MERGEFIELD Clerkship_Title_1 }  = " ", " ", {  MERGEFIELD "Clerkship_Comments_1 }" }

if title1 = blank, then blank, else title1  (like the Access IIF function)

pls advise, tx, s
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question