Iif Statements and text colour

jax

Registered User.
Local time
Today, 08:25
Joined
Mar 4, 2002
Messages
61
I dont know what i would do without this forum it has stopped me tearing my hair out on many occasions - but I am learning fast thanks to all the replies.

Anyway - IIf statments

What I have is two date fields. One details the date a person is due to leave office. The other gives the date if a person has resigned. What i want to do is if either or both of these dates is in the past the text in another field goes red. I can get this working for one or both date fields but not for either or resignation field is blank.

The code I have working at present is:

If Me![Post End Date] And [Resignation Date] <= Date Then
Me![Name].ForeColor = (255)
Else
Me![Name].ForeColor = (0)
End If

I know there is more code I need to add, but cant work out what??
 
Me![Post End Date] And [Resignation Date] <= Date won t do.
Use:

(Me![Post End Date] < Date()) AND (Me![Post End Date] < Date())
instead.

Now, this still doesn t handle the Null problem, since Null < Date() evaluates to Null. This is not what you want!

So you can use whatever trick:
(Nz(Me![Post End Date], Date()-1) < Date()) AND (Nz(Me![Post End Date], Date()-1) < Date())

Alex


[This message has been edited by Alexandre (edited 03-13-2002).]
 

Users who are viewing this thread

Back
Top Bottom