[AccessD] Case Is = Null ?? - Answered!

Charlotte Foust cfoust at infostatsystems.com
Fri Feb 10 12:29:18 CST 2006


But that doesn't tell you if the variable was null, only that it could
have been either null or a zero length string to start with.

Charlotte


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan,
Lambert
Sent: Friday, February 10, 2006 10:24 AM
To: 'Access Developers discussion and problem solving'
Cc: 'Dan Waters'
Subject: Re: [AccessD] Case Is = Null ?? - Answered!


Or, you can do this...

Select Case var & "" 
' above line adds an empty string to our variant variable. This will
turn Nulls in to empty strings, which you can test for.
	Case ""
		' do whatever you need for a Null
	Case "AnotherValue"
		' code
	Case "YetAnotherValue"
		' more code
End Select

So only one Select Case statement needed.

Lambert

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters
Sent: Friday, February 10, 2006 12:45 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Case Is = Null ?? - Answered!


Thanks to everyone!

Charlotte - your suggestion looks good!  I can nest another Select Case
when the expression is not null.

Dan 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte
Foust
Sent: Friday, February 10, 2006 11:07 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Case Is = Null ??

You cannot do comparisons with Null.  NOTHING is equal to null.  You
could do a Select Case Isnull(var) with True and Else cases and then
handle the situations within each branch.

Select Case Isnull(var)
Case True
	Msgbox "Null
Case Else
	Msgbox "Not Null"
End Select

Charlotte Foust


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Andy Lacey
Sent: Friday, February 10, 2006 8:59 AM

To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Case Is = Null ??

Neither of those works, and nor does Case Is = Null.

Simple test function.


Function CaseNull()
Dim var As Variant

var = Null

Select Case var
Case Is = Null                 'The line in question
MsgBox "Null"
Case Else
MsgBox "Not Null"
End Select

End Function


I can't find anything to put in the line in question that gives me a
message of "Null". IsNull and Is Null both error. Is = Null just doesn't
work.

--
Andy Lacey
http://www.minstersystems.co.uk




--------- Original Message --------
From: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
To: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
Subject: Re: [AccessD] Case Is = Null ??
Date: 10/02/06 16:45


Case IsNull

or Case Is Null
'
not sure which one.

Jeffrey F. Demulling
Project Manager
U.S. Bank Corporate Trust Services
60 Livingston Avenue
EP-MN-WS3C
St. Paul, MN 55107-2292
Ph: 651-495-3925
Fax: 651-495-8103
Pager: 888-732-3909
Text Messaging: 8887323909 at my2way.com
email: jeffrey.demulling at usbank.com



"Dan Waters"
<dwaters at usintern
et.com> To
Sent by: "AccessD"
accessd-bounces at d <accessd at databaseadvisors.com> atabaseadvisors.c cc om
Subject [AccessD] Case Is = Null ?? 02/10/2006 10:32 AM


Please respond to
"Access
Developers
discussion and
problem solving"
<accessd at database
advisors.com>






I need to do a Select Case where one of the value could be null. I
thought that Case Is = Null is the correct syntax, but is ignored when
the value is null.

What's the correct way to do this?

Thanks,
Dan



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




------------------------------------------------------------------------
------
Electronic Privacy Notice. This e-mail, and any attachments, contains
information that is, or may be, covered by electronic communications
privacy laws, and is also confidential and proprietary in nature. If you
are not the intended recipient, please be advised that you are legally
prohibited from retaining, using, copying, distributing, or otherwise
disclosing this information in any manner. Instead, please reply to the
sender that you have received this communication in error, and then
immediately delete it. Thank you in advance for your cooperation.
========================================================================
======

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

________________________________________________
Message sent using UebiMiau 2.7.2

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list