changing backcolor based on criteria

Show me a screenshot of your report in Print Preview and show me a (blown-up) screenshot of all your CFs in full.

Then tell me which lines are out of sync.
 
please check out my attachments, i marked up the "a" image with some description of the layout of my DB.

i indicated which field is the job status field which contains the field values i am using as criteria for the conditional formatting. please refer the job status field on the report to the conditional formatting items in the "c" document

please let me know if you need more info.
 

Attachments

  • a.jpg
    a.jpg
    106.7 KB · Views: 174
  • c.jpg
    c.jpg
    94.1 KB · Views: 173
Four things:

1. The job status field name that you are using is incorrect. You are using [job status] whereas the field name is [job_status] (with an underscore).
2. The expressions containing Or is incorrect. An example would be:
Code:
[job_status] = "running" Or [B][COLOR=Red][job_status] =[/COLOR][/B] "setting up" Or [COLOR=Red][B][job_status] = [/B][/COLOR]"1st piece"
3. You need to think about the order of precedence of your conditions. Put the least possible cases at the bottom (if you've not already done that).
4. Ensure that the BackStyle property of the textboxe is set to Normal and not Transparent.
 
you are right again! i needed to reference the field name with each criteria. that did the trick, thank you!
 
How timely I see this being discussed. I have just been asked if I can add some conditional background coloring based on if one of two YesNo fields are true.

I thought I remembered that Access could not do conditional coloring on Forms, only Reports. However this thread seems to suggest it will work on forms.

Currently my application makes use of a selected record colored bar, Rx from here:

"Highlight Current Record in an Access Continuous Form"
http://www.upsizing.co.uk/Art53_Highlight.aspx

Do you think I could not break that and add "background color = red" if either of the check boxes are red?
 
What version of Access are you using?

I don't see why the site suggests adding an extra unbound textbox at the header of the form. Anyway, yes you can perform conditional formatting based on the two criteria:
Code:
[B]Expression Is[/B]
Val([Field1]) + Val([Field2]) < 0
 
All right, I will give it a try in that case. Thanks!

Amazing, it seems to work and not fight with each other. So the green selection bar wins, and the red background exists if the flag field is true and is not the selected record.
 
Here is the results of combining the "selected record colored bar" with two additional conditional formatting rules.

I also attached the Conditional Formatting Rules dialog.
 

Attachments

  • Parts_withColoredObsoleteStopWork.jpg
    Parts_withColoredObsoleteStopWork.jpg
    96.6 KB · Views: 212
  • Parts_withColoredObsoleteStopWork_ConditionalFormattingRules.jpg
    Parts_withColoredObsoleteStopWork_ConditionalFormattingRules.jpg
    49.3 KB · Views: 210

Users who are viewing this thread

Back
Top Bottom