Conditional Format Is Not Value (1 Viewer)

RiskyP

Registered User.
Local time
Today, 09:22
Joined
Jan 3, 2013
Messages
27
Hi,

Have searched all over but cannot find. Is there a way to apply a conditional format if field value is not more than 1 value. For instance I seem to remeber there being an IsNot statement along with an OR statement, however this does not seem to work with conditional formatting

Thanks
 

pr2-eugin

Super Moderator
Local time
Today, 09:22
Joined
Nov 30, 2011
Messages
8,494
Hello Risky, could you explain your requirement in simple words? You can use Not operator to negate the condition you are checking..
Code:
? Not 10 = 10    [COLOR=SeaGreen]'will return False, when 10 is equal to 10[/COLOR]
 

RiskyP

Registered User.
Local time
Today, 09:22
Joined
Jan 3, 2013
Messages
27
Apologies - rushed my question

I have a place name field - i would like the conditional format to apply a colour if the place name is not either of the 3 defined places

For instance - [My-Field] Not Or("Place1","Place2","Place3")

Thanks

Hello Risky, could you explain your requirement in simple words? You can use Not operator to negate the condition you are checking..
Code:
? Not 10 = 10    [COLOR=seagreen]'will return False, when 10 is equal to 10[/COLOR]
 

pr2-eugin

Super Moderator
Local time
Today, 09:22
Joined
Nov 30, 2011
Messages
8,494
Could you give some example?? Just explain what you want to do.. do not worry about technical words or representation..
* PlaceName is it a Control Name? (i.e. is it a text box/combo box)
* What control are you trying to apply the conditional format for?
 

RainLover

VIP From a land downunder
Local time
Today, 18:22
Joined
Jan 5, 2009
Messages
5,041
I assume you are using a Form, but what type.

Single, Continious or Datasheet.

It would be good if you put your Windows and Access versions in your signature.

Different versions have different capabilities.
 

RiskyP

Registered User.
Local time
Today, 09:22
Joined
Jan 3, 2013
Messages
27
Certainly -

The Place name is brought into the report from the master table by a textbox called Place Name. There is Just one textbox but the value could be anything that the user has entered.

I am trying to apply change in the background colour of a seperate empty texbox if the Place name text box value does not equal either of the 3 pre defined places (Place 1,2 or 3) These pre defined values will be manually written into the conditional formatting code

Thanks


Could you give some example?? Just explain what you want to do.. do not worry about technical words or representation..
* PlaceName is it a Control Name? (i.e. is it a text box/combo box)
* What control are you trying to apply the conditional format for?
 

RiskyP

Registered User.
Local time
Today, 09:22
Joined
Jan 3, 2013
Messages
27
Apologies - did not specify - I am using a form based directly from a table in my databse

And will add signiture - but for reference in this thread i am using Access 2010/Windows 7

I assume you are using a Form, but what type.

Single, Continious or Datasheet.

It would be good if you put your Windows and Access versions in your signature.

Different versions have different capabilities.
 

RainLover

VIP From a land downunder
Local time
Today, 18:22
Joined
Jan 5, 2009
Messages
5,041
Thanks for that.

I don't have 2010 so I can't help too much.

But to help others help you what type of form are you using.
 

pr2-eugin

Super Moderator
Local time
Today, 09:22
Joined
Nov 30, 2011
Messages
8,494
So is not as simple as just using a <> operator??
Code:
If (Me.[COLOR=Blue]ctrlName[/COLOR] <> "Place1" OR Me.[COLOR=Blue]ctrlName[/COLOR] <> "Place1" OR Me.[COLOR=Blue]ctrlName[/COLOR] <> "Place1") Then
    [COLOR=SeaGreen]'your code to format[/COLOR]
End If
Blue bits need to change..
 

RiskyP

Registered User.
Local time
Today, 09:22
Joined
Jan 3, 2013
Messages
27
Thanks a lot - Turns out you where sort of there. Shall post for other users;
As it is using the conditional formatting 'wizard' under expressions the code would be;

Code:
[Place Field]<>"Place1" AND [Place Field]<>"Place2".....and so on


So is not as simple as just using a <> operator??
Code:
If (Me.[COLOR=blue]ctrlName[/COLOR] <> "Place1" OR Me.[COLOR=blue]ctrlName[/COLOR] <> "Place1" OR Me.[COLOR=blue]ctrlName[/COLOR] <> "Place1") Then
    [COLOR=seagreen]'your code to format[/COLOR]
End If
Blue bits need to change..
 

pr2-eugin

Super Moderator
Local time
Today, 09:22
Joined
Nov 30, 2011
Messages
8,494
...texbox if the Place name text box value does not equal either of the 3 pre defined places (Place 1,2 or 3) These...
My bad.. I did not give much thought to what I read.. I just looked at Place1, 2 Or 3.. which made me put OR.. re-read your post to find it was different..
 

Users who are viewing this thread

Top Bottom