I'm trying to change the font color of a textbox on a report to red if the date displayed in the textbox is before today. I'm using the following code to accomplish this:
The problem is the value I'm assigning to "EXP1str" is not being evaluated by Access the way I am expecting. Can anyone tell me how to build the value for EXP1str? Or should the type of condition be set to "acFieldVal ue" instead of "acExpressi on"? There's not a lot of guidance in the help files about this.
Thanks in advance for your help!
Code:
Dim Ctrl1 as Textbox Dim CFO As FormatCondition Dim EXP1str as String EXP1str = "[" & Ctrl1.Name & "]<" & Date Set CFO = Ctrl1.FormatConditions.Add(acExpression, , EXP1str ) CFO.ForeColor = RGB(255, 0, 0)
Thanks in advance for your help!
Comment