Solved

Hide Coding based on a list of values for a field

Posted on 2013-01-22
6
538 Views
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

Mike
0
Comment
Question by:BulldogMike
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 37

Expert Comment

by:TommySzalapski
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.
0
 
LVL 37

Expert Comment

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

Assisted Solution

by:jjphardy
jjphardy earned 100 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);
hide_paragraph=!(in_list);
hide_paragraph;

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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 37

Accepted Solution

by:
TommySzalapski earned 400 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.
0
 

Author Comment

by:BulldogMike
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"
0
 

Author Closing Comment

by:BulldogMike
ID: 38818712
Thanks Tom

That was just what I needed

Mike
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Title # Comments Views Activity
ejb example issues 3 53
Run AutoHotkey script directly from Notepad++ 5 143
VB.NET String Settings and Temp Folder Question 3 71
Survey branching tutorial 11 44
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This is about my first experience with programming Arduino.

733 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