Conditional statement not working

gaidheal

Registered User.
Local time
Yesterday, 17:09
Joined
Oct 7, 2008
Messages
18
This is making me crazy.

I have an if...then statement that is not working. I have field on my form called EndDate. If no date is in the field then I need to pop a msgbox reminding the user to enter a date. currently it looks like this:

If Me![EndDate] = Null Then
Response = MsgBox("Please enter ending date", vbDefaultButton1,)
Exit Sub
End If

I put a breakpoint on the code and when the process goes past that first line it tells me that Me.EndDate = Null. Yet it drops right through each time without executing the commands in the If block.
I tried writing it several different ways"
If Me.EndDate = Null Then
If Me!EndDate = Null Then
If (Me.EndDate) = Null Then
etc.

Unless I have hit a bug, it must be a syntax error on my part, yet I don't see it.
 
Never mind. Brain freeze, obviously. The better way
If IsNull(Me.[EndDate]) = True Then
works fine. Trying to evaluate a Null value was not the way to go.
 

Users who are viewing this thread

Back
Top Bottom