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 Format The Background Of Multiple Controls Based The Value Of Two Controls On The Same Form?, Access 2013    
 
   
freespiritcheris...
post Oct 18 2019, 07:37 PM
Post#1



Posts: 155
Joined: 19-October 04



Is it possible to conditional format the background of Multiple Controls based the Value of TWO other controls on the same form? I have needed to add a'gname' field to the table in the sample. I need to highlight the matched number as before, but with a different colour for each person.. what expression can I use? It is currently this..

I've tried so many expression variations..
Thanks in advance.

ps. I have duped this post on an older thread as a reply but thought it better to post as a new questiony. Mod may wish to delete.

regards
Freesp
This post has been edited by freespiritcherishes: Oct 18 2019, 07:37 PM
Attached File(s)
Attached File  Capture1.JPG ( 81.39K )Number of downloads: 10
Attached File  Capture2.JPG ( 174.8K )Number of downloads: 7
Attached File  Capture4.jpg ( 186.18K )Number of downloads: 8
Attached File  modpip.zip ( 77.41K )Number of downloads: 10
 
Go to the top of the page
 
June7
post Oct 18 2019, 09:44 PM
Post#2



Posts: 968
Joined: 25-January 16



Yes, can have multiple criteria in a condition rule. However, what you want is multiple rules. If your list of people will never be more than 50 then you can have a rule for each name. If names in database change, would have to modify rule.

VBA code can set CF rules. Would need a field in table with color code.

However, there could be hundreds of people which means would have to be done with VBA directly setting textbox BackColor property in which case color coding could only take place with report direct to printer or PrintPreview, not ReportView.

I personally don't see the benefit.


This post has been edited by June7: Oct 18 2019, 09:56 PM

--------------------
Attachments Manager is below the edit post window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG! http://www.cpearson.com/Excel/DebuggingVBA.aspx
Go to the top of the page
 
freespiritcheris...
post Oct 19 2019, 04:17 AM
Post#3



Posts: 155
Joined: 19-October 04



Hi June

Thank you for replying. My list of people is 10 and they appear randomly every day. How do I write an expression with two rules? ie.. Erm.. this control = [pip] And [gname] = kathy ... background red-red. this control = pip and gname = florence ..turn background blue... something like that.
This post has been edited by freespiritcherishes: Oct 19 2019, 04:27 AM
Go to the top of the page
 
RJD
post Oct 19 2019, 11:29 AM
Post#4


UtterAccess VIP
Posts: 10,132
Joined: 25-October 10
From: Gulf South USA


Hi: See my response in your other thread HERE. Not easy, but looks do-able.

Note: Better not to post the same issue in two places...

HTH
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
June7
post Oct 19 2019, 02:37 PM
Post#5



Posts: 968
Joined: 25-January 16



Looks like RJD has given you example that follows my suggestion. As that example shows, expression does not have two rules - each control has multiple rules and each rule has an expression with multiple criteria.

If names are random each day, where do they come from? Your example data is a static list of names.

I still don't see benefit. Usually, applying different colors assigns different meaning to the highlight, e.g. Low, Medium, High or Vacation, Training, JuryDuty.

This post has been edited by June7: Oct 19 2019, 02:47 PM

--------------------
Attachments Manager is below the edit post window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG! http://www.cpearson.com/Excel/DebuggingVBA.aspx
Go to the top of the page
 
freespiritcheris...
post Oct 22 2019, 01:07 PM
Post#6



Posts: 155
Joined: 19-October 04



Hi June, Hi Joe,

yes, in fact, I had a v similar notion before I posted the question, I was to see if there might be a code solution to the cumbersome repetitious problem of editing each object. Joe, the sample was great and a keeper, thank you! To be honest, those 70 objects each have 10 different rules, but only needs doing twice..Group A (70s) and Group B (70s) of my project which will make no sense to anyone. Ive done one lot manually, will take my time doing second lot. I might show you all one day if your lucky! fundrink.gif thanks.gif to you.
Go to the top of the page
 
RJD
post Oct 22 2019, 02:10 PM
Post#7


UtterAccess VIP
Posts: 10,132
Joined: 25-October 10
From: Gulf South USA


You are very welcome. You might show us the final db when you get it in case others following this are interested.

Continued success with your project.

Regards,
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
freespiritcheris...
post Oct 22 2019, 07:29 PM
Post#8



Posts: 155
Joined: 19-October 04



ha ha .. Thank you Joe.. omg,, I'd be embarrassed.. I would more likely bribe you or another UA member to 'make it look normal' before I'd do that ha ha.. but will do :-)
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    20th November 2019 - 08:06 AM