Solved

if statement when value is nothing

Posted on 2011-09-12
4
252 Views
Last Modified: 2012-05-12
Hi,

At the beginning of my code, I set a value to nothing like this:
Set Oppen =  Nothing

Later on down in the code, I have an if statement to check that value like this:

if Oppen <> Nothing then........

It does not work.  I've tried these with no luck:

if Oppen <> Nothing then
if Oppen <> Null then
if Oppen is not null then
if Oppen <> Empty then

Thanks for your help,
Joel

0
Comment
Question by:Genius123
  • 2
4 Comments
 
LVL 18

Expert Comment

by:Cluskitt
ID: 36523367
if Oppen Is Not Nothing then
0
 
LVL 23

Expert Comment

by:Brian B
ID: 36523373
Uusally a null value is represented by "":

if oppen <> "" then
0
 
LVL 18

Accepted Solution

by:
Cluskitt earned 250 total points
ID: 36523418
Actually, I have to correct my code to:
if Not Oppen Is Nothing then
0
 

Author Closing Comment

by:Genius123
ID: 36523458
Thanks for the quick reply.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Resolve DNS query failed errors for Exchange
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now