PC Review


Reply
Thread Tools Rate Thread

check if variable is set

 
 
Question Boy
Guest
Posts: n/a
 
      26th Feb 2009
how can I validate if a variable is set in my code?

set olApp = ....

How can i check that this line ran properly and actually set the variable?

IsNull, IsEmpty,Ismissing,... what should I use in this case?

QB
 
Reply With Quote
 
 
 
 
dymondjack
Guest
Posts: n/a
 
      26th Feb 2009
IsEmpty(), I believe.

IsMissing is only for arguments and I'm pretty sure IsNull doesn't work in
this case


--
Jack Leach
www.tristatemachine.com

- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain


"Question Boy" wrote:

> how can I validate if a variable is set in my code?
>
> set olApp = ....
>
> How can i check that this line ran properly and actually set the variable?
>
> IsNull, IsEmpty,Ismissing,... what should I use in this case?
>
> QB

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      28th Feb 2009
On Thu, 26 Feb 2009 11:47:02 -0800, Question Boy
<(E-Mail Removed)> wrote:

>how can I validate if a variable is set in my code?
>
>set olApp = ....
>
>How can i check that this line ran properly and actually set the variable?
>
>IsNull, IsEmpty,Ismissing,... what should I use in this case?
>
>QB


Try

Is Nothing
--

John W. Vinson [MVP]
 
Reply With Quote
 
Marshall Barton
Guest
Posts: n/a
 
      28th Feb 2009
Question Boy wrote:

>how can I validate if a variable is set in my code?
>
>set olApp = ....
>
>How can i check that this line ran properly and actually set the variable?
>
>IsNull, IsEmpty,Ismissing,... what should I use in this case?



Try:
olApp Is Nothing

--
Marsh
MVP [MS Access]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check for environment variable? Fie Fie Niles Microsoft Windows 2000 7 16th Dec 2010 05:10 PM
Check if variable contains a string Ted M H Microsoft Excel Worksheet Functions 5 22nd Dec 2008 03:58 PM
VBA check to see if variable value is odd but not equal to 1 =?Utf-8?B?RGF2ZSBM?= Microsoft Excel Misc 4 21st Nov 2007 01:54 AM
How to check if variable is used? dieter Microsoft VB .NET 2 7th May 2004 10:35 AM
Check Variable =?Utf-8?B?Q2hyaXM=?= Microsoft VB .NET 4 8th Mar 2004 10:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:33 AM.