Color Coding

jbruno

Registered User.
Local time
Today, 16:33
Joined
Oct 9, 2001
Messages
19
I have a report with the following code (which works fine):

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Select Case Color
Case "In-Progress (WHITE)"
Me!Counter.BackColor = 16777215
Me!CC.BackColor = 16777215
Me!Number.ForeColor = 0
Me!CC.ForeColor = 0
Case "Non-FIR Complete (GRAY)"
Me!Counter.BackColor = 12632256
Me!CC.BackColor = 12632256
Me!Number.ForeColor = 0
Case "Possible Verification Issue (RED)"
Me!Counter.BackColor = 255
Me!Number.ForeColor = 16777215
Case "More Information/Clarification Needed (YELLOW)"
Me!Counter.BackColor = 65535
Me!CC.BackColor = 65535
Me!CC.ForeColor = 0
Me!Number.ForeColor = 0
Case "Verified, But Past Due Date (BLACK)"
Me!Counter.BackColor = 0
Me!Number.ForeColor = 16777215
Case "Verified Complete And On-Time (GREEN)"
Me!Counter.BackColor = 4227072
Me!CC.BackColor = 4227072
Me!Number.ForeColor = 16777215
Me!CC.ForeColor = 16777215
End Select
End Sub

I am trying to put similiar code into this report that will change the background and forground colors of a text box based on date. (If x field is this date then color field xx this color). I do not know how to do this as I keep getting error messages. I tried copying and pasting the above code and changing the "select case" and "CC"/"Counter" information to the new names. Is my problem that I'm having it look at a date as apossed to text?

As always, you're help is greatly appreciated.

:(
 
if your using Access 2000 you can use "conditional formatting".

Open report in design view
Select Textbox control
On the menu bar go to Format> Conditional Formatting
In the popup box change the "Field Value Is" to "Expression Is"

Then write something like:
[OrderDate] Between #01/01/02# And #01/30/02#

...changes the textbox to whatever color you choose

Meltdown
 
Last edited:
looking for the same (sort of)

ok,, so on my report, if i have a date and if I want it to be the color red if it is less than todays date....

how would that look? how would I express this?

thanks
 
"Field Value Is" "Less Than" Date()

IMO
 
thanks

it worked but with a twist. for some reason,,, it is showing more red than it should... must be something on my end...

But thank you for the help..it is doing what i want just need to tweek it a little bit more
 

Users who are viewing this thread

Back
Top Bottom