How do you get the month you are filtering on?
If you want to gray the field only if it equal to the current month, then
If month(Me.[Authorization Date]) = month(date()) then
me.[Authorization Date].BackColor = 12632256 'Gray
Else
me.[Authorization Date].BackColor = 16777215 'White
End If
Or you can use
If month(Me.[Authorization Date]) = 1 then ' Jan
me.[Authorization Date].BackColor = 12632256 'Gray
Else
me.[Authorization Date].BackColor = 16777215 'White
End If
========================================
I feel that I don't fully understand what you are trying to do.
April Klein said:
How would I make that specific to the January field and then repeat it for
the February, March, etc? I need them each to shade idependant of eachother
- based on the Auth Date.
--
~April
Ofer said:
On the Format property of the section where the field is, you can write the
code
If Me.[Authorization Date]>= #1/1/2005# and Me.[Authorization Date] <=
#31/1/2005# then
me.[Authorization Date].BackColor = 12632256 'Gray
Else
me.[Authorization Date].BackColor = 16777215 'White
End If
-------------------------------------------------------------
Or
You can check about conditional formatting, incase that filter is fixed.
:
I have created a report where I need to add shading to a field. This field
should auto-shade if a date is within a certain range. There are twelve
cells (one for each month).
For example : if Authorization Date is bewteen Jan 1 2005 and Jan 31 2005
then shade grey, if not it would remain normal.
Can this be written as an event code specific to only that field?
Thanks for any help you can provide.