Normal Topic Excluding Groups (Read 672 times)
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Excluding Groups
May 23rd, 2013 at 6:49pm
Print Post Print Post  
I have many different groups accessing a form.  I have several command buttons on the form.  I want to turn off some of the command buttons for three groups.  I tried using the following programming, but it doesn't seem to work. 

If @Group<>"Basic User" or @Group<>"Setup" or @Group<>"Mill"
{
     Visibility(Command1,0)
}

Is there a way to identify multiple groups and have the programming respond for each group?

  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Excluding Groups
Reply #1 - May 23rd, 2013 at 7:01pm
Print Post Print Post  
Hi Paul,

Are you trying to make that button invisible for people in those three group? If so you want

Code
Select All
If @Group="Basic User" or @Group="Setup" or @Group="Mill"
{
     Visibility(Command1,0)
} 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Excluding Groups
Reply #2 - May 23rd, 2013 at 7:07pm
Print Post Print Post  
If you are trying to run that code if the group is none of the listed groups, you will need to use "and" not "or".

"Or" tells the "if" statement that if any of the conditions is true, run the code. Since you are checking two (or more) "not-equal" conditions, they are always true, because group cannot be equal to "Basic User" and "Setup" at the same time, so one or both of those conditions is always true.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Excluding Groups
Reply #3 - May 23rd, 2013 at 7:27pm
Print Post Print Post  
Ray, I have about 20 groups and I am trying to make a statement that says "all groups except Basic Users, Setup and Mill" have access to these buttons.  I thought this would be easier than listing the other 17 groups.

I think Mark's suggestion will work.  I'll give it a try.
  
Back to top
 
IP Logged