Solved

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

Posted on 2012-04-09
3
250 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

860 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