Solved

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

Posted on 2012-04-09
3
241 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
Comment Utility
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
Comment Utility
"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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now