Hide Coding based on a list of values for a field

Posted on 2013-01-22
Medium Priority
Last Modified: 2013-12-18
OK  I give up – you code it – mine is not working

I am trying to code the hiding or displaying of a section of text, a subform and a layout region in Lotus Notes v5 as follows:  

If the value for Field A (DRG_DEA_CLC) is not equal to “0001” or “0002” or “0003” or “0004” or “0005” hide it, otherwise display it.   DRG_DEA_CLC != "0001" works but not the rest

Here are my hiding coding failures so far in the hide/display box:
DRG_DEA_CLC != "0001" | DRG_DEA_CLC !="0002" | DRG_DEA_CLC !="0003" |
DRG_DEA_CLC!="0004" | DRG_DEA_CLC != "0005"

DRG_DEA_CLC != "0001" | 0002" | "0003" | 0004" | != "0005"

Thanks - I hate Syntax

Question by:BulldogMike
  • 3
  • 2
LVL 37

Expert Comment

ID: 38807649
You want "and" not "or"

My guess is you want DRG_DEA_CLC != "0001" & DRG_DEA_CLC !="0002" etc etc

Everything is either not 1 or not 2, you want things that are both not 1 and not 2 etc.

So take your first attempt and replace every | with & and see how that works.
LVL 37

Expert Comment

ID: 38807657
Since lotus notes uses VBA, you may want the actual word "and" if the & doesn't work.

Assisted Solution

jjphardy earned 400 total points
ID: 38810911
Is DRG_DEA_CLC a list? If so != will not work. Unless all the values in a list are the same this will always return false.

Even if it is not a list. or not equal to will always return a false.

This may work for you.
val_list="0001" :"0002":"0003" :"0004":"0005";
in_list=(DRG_DEA_CLC = val_list);

It is not that clear if you want to hide or show your paragraph if DRG_DEA_CLC is equal to the values you supplied. I am assuming you want to show the paragraph.

val_list is a list of the values you want to test against.
in_list should be true if DRG_DEA_CLC is equal to any value in the list.
hide_paragraph will be false if DRG_DEA_CLC is equal to any value in the list.
The last line is what the formula will evaluate to.
If it is false, the paragraph will not hide.
If it is true the paragraph will show.
7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

LVL 37

Accepted Solution

TommySzalapski earned 1600 total points
ID: 38811374
Since DRG_DEA_CLC != "0001" worked, I think that using "and" is all that is needed.
Saying "X does not equal 1 or 2 or 3" in English translates to "X != 1 and X != 2 and X != 3" in programming. It's a very common source of confusion.

Author Comment

ID: 38818660
Thanks for your replies, I have been out of the office for 2 days

Clarification of my Request:

I want to code the hiding or display of 1) some text 2) a layout region and 3) a sub-form based on the value of the DRG_DEA_CLC component.  

In English: If the value of DRG_DEA_CLC is not equal to "0001 or not equal to "0002" or not equal to "0003" or not equal to "0004" or not equal to "0005" then hide it or display it as appropriate.  

I also have other 1) text 2) another layout region and 3) another sub-form to display or hide if the value of DRG_DEA_CLC is not equal to "0000".  

I have tried your suggestions with varying degrees of success.

Thanks for your attention to this request

 Mike - "I hate syntax"

Author Closing Comment

ID: 38818712
Thanks Tom

That was just what I needed


Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Make the most of your online learning experience.
Today, unlike web development, the mobile landscape is complex enough for a software engineer and Android is posing more challenging environment thanks to its fragmentation issues on hardware and software fronts.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

607 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