By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,693 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,693 IT Pros & Developers. It's quick & easy.

If is being ignored!

P: 10
I've put this line into my code

Expand|Select|Wrap|Line Numbers
  1. If Me.Text3 = Null Then
  2.     MsgBox "Please enter the date of the exam", vbExclamation, "Date Missing"
  3.     Exit Sub
  4. 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?
Feb 12 '08 #1
Share this Question
Share on Google+
2 Replies

Expert 2.5K+
P: 2,653
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.

Feb 12 '08 #2

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

Feb 12 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.