UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Conditional Formatting - Color From Table?, Access 2016    
 
   
wheeledgoat
post Jun 26 2019, 12:53 PM
Post#1



Posts: 67
Joined: 18-December 18



Howdy you Access Gurus out there,

I've a continuous form in which I'd like to do some Conditional Formatting. Each user has their own color (Access color code, stored in a table, referenced and used with no problem in other queries and forms). I'd like to use the user's custom color in the Conditional Formatting, though, and I can't seem to figure how to reference the tblUser to get the user's color.

I can get the color programmatically, but setting the txtbox.backcolor to that with vba changes ALL the continuous forms based on the active record.

I can get the Conditional Formatting to work great if I manually set it up, but there will be users added and obviously it would be best to only have to set the user's color in one place and not have to go into the Conditional Formatting for this one field to add them there as well.

I'd greatly appreciate any ideas - I'm totally stuck.

Thanks!!

--------------------
"If you don't make mistakes, you're not working on hard enough problems." -Frank Wilczek

"Success is getting what you want. Happiness is wanting what you get." -B.R. Hayden

Virtue is sufficient for happiness, therefore a sage is immune to misfortune.
Go to the top of the page
 
theDBguy
post Jun 26 2019, 12:55 PM
Post#2


Access Wiki and Forums Moderator
Posts: 76,425
Joined: 19-June 07
From: SunnySandyEggo


Hi. How many colors do you need to use?

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
wheeledgoat
post Jun 26 2019, 01:00 PM
Post#3



Posts: 67
Joined: 18-December 18



Hey DBGuy,

Each user has their own color - we're at around 20 right now. (Yes, it's a challenge to find contrasting ones that differ enough from one another to be meaningful - it helps that these are broken into different groups, but I think I'm straying from the point).

--------------------
"If you don't make mistakes, you're not working on hard enough problems." -Frank Wilczek

"Success is getting what you want. Happiness is wanting what you get." -B.R. Hayden

Virtue is sufficient for happiness, therefore a sage is immune to misfortune.
Go to the top of the page
 
theDBguy
post Jun 26 2019, 01:23 PM
Post#4


Access Wiki and Forums Moderator
Posts: 76,425
Joined: 19-June 07
From: SunnySandyEggo


No, what I meant was, basically, how many conditional rules do you need for adjusting the color?

Are you saying the "rule" is check the person and then match his/her color?

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
wheeledgoat
post Jun 26 2019, 01:32 PM
Post#5



Posts: 67
Joined: 18-December 18



I was hoping to just have one rule with code to change the color based on txtbox contents. I'd be happy to do a dlookup or just pull the color from the source query.

--------------------
"If you don't make mistakes, you're not working on hard enough problems." -Frank Wilczek

"Success is getting what you want. Happiness is wanting what you get." -B.R. Hayden

Virtue is sufficient for happiness, therefore a sage is immune to misfortune.
Go to the top of the page
 
theDBguy
post Jun 26 2019, 02:12 PM
Post#6


Access Wiki and Forums Moderator
Posts: 76,425
Joined: 19-June 07
From: SunnySandyEggo


Okay, if you only need one rule (you can have up to three), then you should be able to set it up using VBA. Check out the FormatCondition object.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
wheeledgoat
post Jun 26 2019, 03:00 PM
Post#7



Posts: 67
Joined: 18-December 18



Thanks for the reply. I'm looking at the FormatCondition object and it just sets the backcolor using vba. Won't this change the txtbox color for all of the continuous forms based on the active record?

--------------------
"If you don't make mistakes, you're not working on hard enough problems." -Frank Wilczek

"Success is getting what you want. Happiness is wanting what you get." -B.R. Hayden

Virtue is sufficient for happiness, therefore a sage is immune to misfortune.
Go to the top of the page
 
theDBguy
post Jun 26 2019, 03:16 PM
Post#8


Access Wiki and Forums Moderator
Posts: 76,425
Joined: 19-June 07
From: SunnySandyEggo


No, it won't because it's the same as using the Conditional Formatting user interface. The difference is, you can look up the color you want to apply with code.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    22nd October 2019 - 09:20 PM