Code

P

Pass-the-reality

I have used the below Code in another Query to help highlight percentages in
either Red or Green. I need to use the same Code, but instead of <=0.75, I
need it to say <= Todays Date. What can I add to the code to base it off of
the date the report is pulled.


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Const conNormal = 400
Const conHeavy = 900 'extra Bold

If [Overall Score] <= 0.75 Then
[Overall Score].FontWeight = conHeavy
[Overall Score].ForeColor = vbRed
Else
If [Overall Score] >= 0.95 Then
[Overall Score].FontWeight = conHeavy
[Overall Score].ForeColor = vbGreen
End If
End If
 
D

Douglas J. Steele

What do you mean by "the date the report is pulled"? If all you're trying to
do is compare some date value to the current day's date, use the Date()
function where you have .75 in your existing code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top