Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-06-2011, 09:28 AM
robpgreer robpgreer is offline Syntax Help Needed for Using AND Statement in NEXIF Windows 7 64bit Syntax Help Needed for Using AND Statement in NEXIF Office 2010 32bit
Novice
Syntax Help Needed for Using AND Statement in NEXIF
 
Join Date: May 2011
Location: Los Angeles
Posts: 7
robpgreer is on a distinguished road
Default Syntax Help Needed for Using AND Statement in NEXIF

I'm a new member with a burning question!



Can anyone PLEASE help me figure this one out? I've been searching via Google for hours to no avail. I'm trying to figure out the correct syntax in MS Word 2007 to do a SKIPIF if ALL of the following are true.

{ SKIPIF { MERGEFIELD field1 }= "" }
{ SKIPIF { MERGEFIELD field2 }= "" }
{ SKIPIF { MERGEFIELD field3 }= "" }
{ SKIPIF { MERGEFIELD field4 }= "" }

Any ideas?

Thanks a bunch!
Reply With Quote
  #2  
Old 05-06-2011, 10:01 AM
macropod's Avatar
macropod macropod is offline Syntax Help Needed for Using AND Statement in NEXIF Windows 7 32bit Syntax Help Needed for Using AND Statement in NEXIF Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Hi Rob,

You've got the basic construction OK. The code says to skip the record if any of the fields 1-4 is empty. Is that what you're trying to achieve?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-06-2011, 10:11 AM
robpgreer robpgreer is offline Syntax Help Needed for Using AND Statement in NEXIF Windows 7 64bit Syntax Help Needed for Using AND Statement in NEXIF Office 2010 32bit
Novice
Syntax Help Needed for Using AND Statement in NEXIF
 
Join Date: May 2011
Location: Los Angeles
Posts: 7
robpgreer is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
The code says to skip the record if any of the fields 1-4 is empty. Is that what you're trying to achieve?
I'd like it to skip if ALL of them are empty. Otherwise I want it to print.
Reply With Quote
  #4  
Old 05-06-2011, 10:27 AM
macropod's Avatar
macropod macropod is offline Syntax Help Needed for Using AND Statement in NEXIF Windows 7 32bit Syntax Help Needed for Using AND Statement in NEXIF Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Hi Rob,

In that case, you need something like:
{SKIPIF{={IF{MERGEFIELD field1}= "" 0 1}+{IF{MERGEFIELD field2}= "" 0 1}+{IF{MERGEFIELD field3}= "" 0 1}+{IF{MERGEFIELD field4}= "" 0 1}}= 0}
If your mergefields have numeric values, the field code could be simplified somewhat.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 05-06-2011, 10:36 AM
robpgreer robpgreer is offline Syntax Help Needed for Using AND Statement in NEXIF Windows 7 64bit Syntax Help Needed for Using AND Statement in NEXIF Office 2010 32bit
Novice
Syntax Help Needed for Using AND Statement in NEXIF
 
Join Date: May 2011
Location: Los Angeles
Posts: 7
robpgreer is on a distinguished road
Default

Hrrm. I tried it and that didn't work. I'm searching through text fields. Here's the exact syntax I'm using. Am I missing a space or bracket?

{ SKIPIF {={ IF {MERGEFIELD attendance_comments}= "" 0 1}+{IF { MERGEFIELD assignment_comments}= "" 0 1}+{ IF { MERGEFIELD grading_comments}= "" 0 1}+{IF { MERGEFIELD submit_grades_comments}= "" 0 1}+{ IF { MERGEFIELD report_comments}= "" 0 1}+{ IF { MERGEFIELD parent_access_comments}= "" 0 1}+{ IF { MERGEFIELD Please_share_any_additional_feature_req}= "" 0 1}}= 0 }
Reply With Quote
  #6  
Old 05-06-2011, 10:52 AM
robpgreer robpgreer is offline Syntax Help Needed for Using AND Statement in NEXIF Windows 7 64bit Syntax Help Needed for Using AND Statement in NEXIF Office 2010 32bit
Novice
Syntax Help Needed for Using AND Statement in NEXIF
 
Join Date: May 2011
Location: Los Angeles
Posts: 7
robpgreer is on a distinguished road
Default

And I've also tried dumping all of the spaces I added to mimic your suggestion more closely:

{SKIPIF{={IF{MERGEFIELD attendance_comments}= "" 0 1}+{IF{MERGEFIELD assignment_comments}= "" 0 1}+{IF{MERGEFIELD grading_comments}= "" 0 1}+{IF{MERGEFIELD submit_grades_comments}= "" 0 1}+{IF{MERGEFIELD report_comments}= "" 0 1}+{IF{MERGEFIELD parent_access_comments}= "" 0 1}+{IF{MERGEFIELD Please_share_any_additional_feature_req}= "" 0 1}}= 0}
Reply With Quote
  #7  
Old 05-06-2011, 02:22 PM
macropod's Avatar
macropod macropod is offline Syntax Help Needed for Using AND Statement in NEXIF Windows 7 32bit Syntax Help Needed for Using AND Statement in NEXIF Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Hi Rob,

Your field construction is just fine. Did you use Ctrl-F9 for all the field brace pairs (ie '{}')?

There's a macro I wrote for converting the textual field representation into true fields at: http://www.gmayor.com/export_field.htm#TextToField
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #8  
Old 05-06-2011, 03:02 PM
robpgreer robpgreer is offline Syntax Help Needed for Using AND Statement in NEXIF Windows 7 64bit Syntax Help Needed for Using AND Statement in NEXIF Office 2010 32bit
Novice
Syntax Help Needed for Using AND Statement in NEXIF
 
Join Date: May 2011
Location: Los Angeles
Posts: 7
robpgreer is on a distinguished road
Default

Awesome! Between the converter Macro and your syntax I've gotten it working. You're the best!
Reply With Quote
  #9  
Old 08-10-2011, 04:24 PM
surrendertoo surrendertoo is offline Syntax Help Needed for Using AND Statement in NEXIF Windows XP Syntax Help Needed for Using AND Statement in NEXIF Office 2010 32bit
Novice
 
Join Date: Aug 2011
Posts: 2
surrendertoo is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Hi Rob,

Your field construction is just fine. Did you use Ctrl-F9 for all the field brace pairs (ie '{}')?

There's a macro I wrote for converting the textual field representation into true fields at: http://www.gmayor.com/export_field.htm#TextToField
I've also had issues combining criteria in a SKIPIF statement. Here's my code:
{ SKIPIF { = {IF {mergefield} < 1000 "0" "1" } + { IF {mergefield} < 2 "0" "1" } = "0" }


Can you identify any issues with this? Many thanks!
Reply With Quote
  #10  
Old 08-11-2011, 02:43 AM
macropod's Avatar
macropod macropod is offline Syntax Help Needed for Using AND Statement in NEXIF Windows 7 64bit Syntax Help Needed for Using AND Statement in NEXIF Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Hi surrendetoo,

You need to specifiy the data field names for the test. Also, you can eliminate the double quotes:
{SKIPIF {={IF{MERGEFIELD Fld1Nm}< 1000 0 1}+{IF{MERGEFIELD Fld2Nm}< 2 0 1}= 0}
where Fld1Nm and Fld2Nm are your data field names (they can be the same).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #11  
Old 08-11-2011, 04:58 PM
surrendertoo surrendertoo is offline Syntax Help Needed for Using AND Statement in NEXIF Windows XP Syntax Help Needed for Using AND Statement in NEXIF Office 2010 32bit
Novice
 
Join Date: Aug 2011
Posts: 2
surrendertoo is on a distinguished road
Default

Thanks macropod, but I'm still not having success. Would you mind reviewing one more time for any errors?
{SKIPIF{ ={IF { MERGEFIELD field_1}< 10000 0 1 }+{ IF{ MERGEFIELD field_2 }< 2 0 1 }= 0 }} Thank you!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax Help Needed for Using AND Statement in NEXIF Can't seem to get the correct syntax for Wine list mailmerge daym Mail Merge 3 05-02-2011 03:26 AM
Syntax Help Needed for Using AND Statement in NEXIF Help with IF Statement limpbizkit Excel 4 02-24-2011 09:16 PM
Syntax Help Needed for Using AND Statement in NEXIF if statement piper7971 PowerPoint 1 08-19-2010 07:10 AM
Syntax Help Needed for Using AND Statement in NEXIF Help with IF statement! CPelkey Word 1 04-12-2010 09:06 AM
Syntax Help Needed for Using AND Statement in NEXIF Syntax help needed blazzercat Excel 3 07-09-2009 02:15 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:44 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