Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-28-2021, 05:10 PM
Formd Formd is offline If and/or in mailmerge Windows 7 32bit If and/or in mailmerge Office 2007
Advanced Beginner
If and/or in mailmerge
 
Join Date: Feb 2015
Location: TX
Posts: 46
Formd is on a distinguished road
Question If and/or in mailmerge

I am using a template to mailmerge a document using multiple "If" conditions.


The outcome should merge a letter, only if the status is not "Expired" and if definitions shows "Client/Pat" or Client/Set.
Problem is, the info still merges if status is "Expired". What am I doing wrong?
Attached is my template, sample db and my document after merged.


IF Definition1 = Client/Pat OR Definition1 = Client/Set AND Status1 is not = Expired
then letter should merge.

This is the code I am using:
IF{={IF{MERGEFIELD Definition1}= "Client/Pat" 1 0}+{IF{MERGEFIELD Definition1} = "Client/Set" 1 0} \# 0}>0 {IF{MERGEFIELD Status1} = "Expired" "" "Letter goes here"}
Attached Files
File Type: doc Template.doc (42.0 KB, 6 views)
File Type: xlsx Data.xlsx (8.9 KB, 5 views)
File Type: doc Merge Outcome.doc (27.0 KB, 4 views)
Reply With Quote
  #2  
Old 09-28-2021, 06:49 PM
macropod's Avatar
macropod macropod is offline If and/or in mailmerge Windows 10 If and/or in mailmerge Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You need a space after the >
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 09-29-2021, 09:06 AM
Formd Formd is offline If and/or in mailmerge Windows 7 32bit If and/or in mailmerge Office 2007
Advanced Beginner
If and/or in mailmerge
 
Join Date: Feb 2015
Location: TX
Posts: 46
Formd is on a distinguished road
Default

Thank you for responding Paul.
I placed a space after the > and tested, but got the same results.

IF{={IF{MERGEFIELD Definition1}= "Client/Pat" 1 0}+{IF{MERGEFIELD Definition1} = "Client/Set" 1 0} \# 0}> 0 {IF{MERGEFIELD Status1} = "Expired" "" "Letter goes here"}
Reply With Quote
  #4  
Old 09-29-2021, 07:12 PM
macropod's Avatar
macropod macropod is offline If and/or in mailmerge Windows 10 If and/or in mailmerge Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Are you actually completing the merge, or just previewing it?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 09-30-2021, 05:11 AM
Formd Formd is offline If and/or in mailmerge Windows 7 32bit If and/or in mailmerge Office 2007
Advanced Beginner
If and/or in mailmerge
 
Join Date: Feb 2015
Location: TX
Posts: 46
Formd is on a distinguished road
Default

Hi Paul
I actually ran the merge. Did it a few times.

Last edited by Formd; 09-30-2021 at 07:28 AM.
Reply With Quote
  #6  
Old 09-30-2021, 07:07 PM
macropod's Avatar
macropod macropod is offline If and/or in mailmerge Windows 10 If and/or in mailmerge Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Are you using the correct capitalizations for the tests? Also, what are the possible outputs for Definition1?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 11-04-2021, 03:07 PM
Formd Formd is offline If and/or in mailmerge Windows 7 32bit If and/or in mailmerge Office 2007
Advanced Beginner
If and/or in mailmerge
 
Join Date: Feb 2015
Location: TX
Posts: 46
Formd is on a distinguished road
Default

Hi Paul
After reviewing my codes several times, I removed an extra space in one of my
mergefields. Because the mergefield was incorrect it did not work. After correcting the mergefield, it works. Thanks as always for your help.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
If and/or in mailmerge Macro to insert an image to a word mailmerge document based on the value of a mailmerge field? Jake93 Mail Merge 3 07-02-2019 05:38 PM
Can you CC somebody on a MailMerge? constructionjasont Mail Merge 2 06-28-2017 06:01 AM
If and/or in mailmerge Mailmerge to Email with a mailmerge attachment Baldeagle Mail Merge 8 02-11-2013 04:40 AM
If and/or in mailmerge Mailmerge to Email with a mailmerge attachment Baldeagle Mail Merge 13 05-29-2012 02:04 PM
Help with mailmerge??? foxtrot1981 Mail Merge 0 12-03-2010 08:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:02 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft