If is being ignored!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ginge6000
    New Member
    • Feb 2008
    • 10

    If is being ignored!

    I've put this line into my code

    Code:
    If Me.Text3 = Null Then
        MsgBox "Please enter the date of the exam", vbExclamation, "Date Missing"
        Exit Sub
    End If
    but every time I run it just seems to skip the if statement and keep going. This happens when I change the Null to "" or even to a value and then enter that in the text box. Am I going mad?
  • FishVal
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #2
    Hi, there.

    Don't go mad. Just keep in mind that expression like
    Something = Null
    will never return True or False, but always Null which is treated by If...Then as False.
    Thats why there is a special function - IsNull(), to check whether some variable has Null value.

    Regards,
    Fish

    Comment

    • ginge6000
      New Member
      • Feb 2008
      • 10

      #3
      I so knew that! Man it's been a long ole day! Thanks for your polite response (I would have been much more sarcastic!)

      Ben

      Comment

      Working...