Less then

Infinite

More left to learn.
Local time
Yesterday, 18:21
Joined
Mar 16, 2015
Messages
402
Hello! I have 4 fields, each of them are in the report, and they have Conditional formatting, so if its > 1, then red. What I need to do is, if 4 of the fields are normal, then make this field blue. If 3 of the fields are black, then make this Blue, if 2 of the fields are black, then make this Green, if one of the fields are black, then make this Red, if none of the fields are black, make this red.

I have other things instead of the color red...How about

If 4 black = 4
If 3 black = 3
If 2 black = 2
If 1 black = 1
If 0 black = 0

I need them to have other pictures to. You can just look at the attached picture, should explain it. If you need any more, just ask, and ill try to tell you what I know.

Also, those numbers are from a excel spreadsheet, but I would like that in access. It helps to measure shows. Like, the show was a 1 "star" or a 4 "star" if you know what I mean. Thanks!
 

Attachments

  • Red.PNG
    Red.PNG
    55.7 KB · Views: 116
Last edited:
After reading your post several times I am still unclear of exactly what you need to do. Since we do not understand what your database is supposed. For me this image did not help explain the logic required to code the desired results.

This appears to be beyond the expression capabilities for Conditional formatting. In that case you will need to use the report section's On Format event and use VBA code to do what you need.
 
Sorry about that, I I figured it out awhile ago.

Code:
Profit Rating: IIf(Sgn([1-Star Profit])+Sgn([2-Star Profit])+Sgn([3-Star Profit])+Sgn([4-Star Profit])=4,"❹❹❹❹",IIf(Sgn([1-Star Profit])+Sgn([2-Star Profit])+Sgn([3-Star Profit])+Sgn([4-Star Profit])=2,"❸❸❸",IIf(Sgn([1-Star Profit])+Sgn([2-Star Profit])+Sgn([3-Star Profit])+Sgn([4-Star Profit])=0,"❷❷",IIf(Sgn([1-Star Profit])+Sgn([2-Star Profit])+Sgn([3-Star Profit])+Sgn([4-Star Profit])=-2,"❶",IIf(Sgn([1-Star Profit])+Sgn([2-Star Profit])+Sgn([3-Star Profit])+Sgn([4-Star Profit])=-4,"⓿")))))

That was able to do exactly what i needed it to do. It just took me awhile. Its still not what I need, as I need a %15 fudge factor, but its pretty close for me.
 

Attachments

  • Ms Access Report.PNG
    Ms Access Report.PNG
    29.4 KB · Views: 111

Users who are viewing this thread

Back
Top Bottom