[AccessD] Null in table and code

Kaup, Chester Chester_Kaup at kindermorgan.com
Tue Apr 7 16:11:02 CDT 2015


That makes sense. Some of the records in the table were just created with a date only as place holders. Thanks.

-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust
Sent: Tuesday, April 07, 2015 3:49 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Null in table and code

You have to use a variant variable if you want to be able to handle nulls.
Otherwise, just use the Nz() function to return a 0 or a -1 if the value is null.  The null in the table means it's unpopulated, which you can correct for new records with a default value.  You would need an update query to insert the "default" into records that are currently null.


Charlotte Foust
(916) 206-4336

On Tue, Apr 7, 2015 at 1:32 PM, Kaup, Chester <Chester_Kaup at kindermorgan.com
> wrote:

> I have a field named oil in a table that is defined as numeric single. 
> In some records this field is null. I have some code in which I have a 
> variable defined as a single. When I try to write a field that is null 
> from the table to the variable I get a message of invalid use of a 
> null. How can a single in a table hold a null but a variable defined 
> as a single in code not contain a null?
> --
> 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