Conditional Statement going to "else" no matter what

Dylan Snyder

Registered User.
Local time
Today, 17:38
Joined
Dec 31, 2007
Messages
89
Okay, I have a conditional statment that works, but runs through the "Then" and "Else" cases no matter what Me.Check_Field equals. I get the Msg Box no matter what. I'm probably doing something incorrectly, but I've done conditional statments this way in the past and they worked. I have pasted the code below. Any glaring flaws? I'm new at all this, so go easy...
Code:
Private Sub New_Ship_Date_BeforeUpdate(Cancel As Integer)

    Me.Check_Field = Null
    DoCmd.Close acForm, "C04 - Matched Ship Dates", acSaveYes
    DoCmd.OpenForm "C04 - Matched Ship Dates", acNormal, , , acFormEdit, acHidden
    Me.Check_Field = [Forms]![C04 - Matched Ship Dates]![Date entered]
    
[COLOR="Red"]If Me.Check_Field = Null Then
    Me.Check_Field = Null
Else
    MsgBox "This date has been previously requested on " + Me.Check_Field & vbCrLf & "Please verify that this request is correct."
End If[/COLOR]
End Sub
 
Last edited by a moderator:
please ignore the End Sub on the same line on the last line, that happened when I entered it on the thread.
 
If IsNull(Me.Check_Field)

Try that.
 
worked like a champ. Thanks a lot. I guess "= Null" works some of the time. Appreciate the help.
 

Users who are viewing this thread

Back
Top Bottom