Null Date Field Question

Judy

Registered User.
Local time
Today, 22:42
Joined
Sep 26, 2000
Messages
34
Hopefully this is not too trivial to post on this board, but it's making me crazy! I have a termination date field in my table and and a field on a form that is visible only if the employee is terminated (date filled in). My expression is as follows:

If Me![TermDate] <> Null Then
Me![field].Visible = True
Me![TermDate].Visible = True
Else
Me![field].Visible = False
Me![TermDate].Visible = False
End If

I've tried stepping through this code and it won't recognizes the <> Null.

Any ideas?

Thanks!!!!
 
Hi Judy,

try
If Not IsNull(Me![TermDate]) Then
...

That should sort it

HTH

Drew
 
I suggest doing it in reverse and testing for a null:

If IsNull(Me.TermDate) Then
Me![field].Visible = False
Me![TermDate].Visible = False
Else
Me![field].Visible = True
Me![TermDate].Visible = True
End If

HTH
Rob
 
I tried the first suggestion and it worked great. I don't know why I didn't think of switching the if statement around (duh!). Thanks for both suggestions! I did notice, however, that both replies use the IsNull function - that was my problem, I wasn't using IsNull.

Thanks!

[This message has been edited by Judy (edited 07-31-2001).]
 
I am sure that I read somewhere that you can not use mathematic operators to evaluate Null. This means that you can't say ' = Null ' or ' <> Null'.
Chris
 

Users who are viewing this thread

Back
Top Bottom