Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access 2010 - If stmt not executing on true value of NULL

Posted on 2011-09-18
2
Medium Priority
?
320 Views
Last Modified: 2012-05-12
I have the following IF stmt:

if recordset1!samplevalue = null then
  msgbox "true"
else
  msgbox "false"
end if

The value of recordset1!samplevalue is NULL but the message "true" is skipped over and "false" is printed instead.  I've also tried using "if recordset1!samplevalue is null" but wrong answer pops up.
0
Comment
Question by:SFWolverine
2 Comments
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 500 total points
ID: 36558310
try this

If isnull(recordset1!samplevalue) then

msgbox "true"

else
  msgbox "false"
end if
0
 

Author Closing Comment

by:SFWolverine
ID: 36558406
Thank you!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question