Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-25-2022, 06:30 PM
saltwater saltwater is offline Windows 10 Office 2021
Novice
Boolean data field - how to correctly handle it
 
Join Date: Nov 2022
Location: Melbourne, Australia
Posts: 2
saltwater is on a distinguished road
Default Boolean data field - how to correctly handle it

On a one record data source (a table from an Access database) I'm having difficulty handling various Boolean data fields. The data field 'HasAnAddressYES' is false. There is another data field 'HasAnAddressNO' that is true. (I didn't design the system, I've been asked to maintain it.)



Anyway, here is the underlying merge code:

Code:
{ IF { MERGEFIELD "HasAnAddressYES" } "Yes address" "No address" }
on toggling the code, it reverts to this:

Code:
{ IF False "Yes address" "No address" }
And the result is "Yes address".

The problem is, the the Boolean data field is False, and therefore I want displayed "No Address".

Any advice appreciated.

Steve.
Reply With Quote
  #2  
Old 11-26-2022, 04:46 AM
macropod's Avatar
macropod macropod is online now Boolean data field - how to correctly handle it Windows 10 Boolean data field - how to correctly handle it 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

Seems rather strange to have two data fields for the same thing.

Regardless, from your description, it seems you should be able to use:
{IF{MERGEFIELD HasAnAddressYES} = TRUE "Yes address" "No address"}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 11-26-2022, 05:26 AM
macropod's Avatar
macropod macropod is online now Boolean data field - how to correctly handle it Windows 10 Boolean data field - how to correctly handle it 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

Cross-posted at: Word Mailmerge : Boolean data field - how to handle it | Microsoft Answers
For cross-posting etiquette, please read: A message to forum cross posters - Excelguru
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 11-27-2022, 05:06 PM
saltwater saltwater is offline Windows 10 Office 2021
Novice
Boolean data field - how to correctly handle it
 
Join Date: Nov 2022
Location: Melbourne, Australia
Posts: 2
saltwater is on a distinguished road
Default

Thank you, cross-posting issue noted. The other forum is the primary thread.
Reply With Quote
Reply

Tags
boolean

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Returning Boolean Bikram Word VBA 4 04-04-2022 07:39 PM
Boolean data field - how to correctly handle it Loop through Multiple Boolean Variables ScottyBee Word VBA 8 03-25-2019 03:24 PM
Merge field source data field kckay Mail Merge 4 03-25-2013 11:06 AM
Boolean data field - how to correctly handle it Mail Merge: cannot display the field in Excel correctly derricklo1980 Mail Merge 5 08-16-2012 07:15 PM
Boolean data field - how to correctly handle it Mail Merge: cannot display the field in Excel correctly derricklo1980 Excel 1 08-16-2012 12:51 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:42 AM.


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