[AccessD] Null in table and code

Charlotte Foust charlotte.foust at gmail.com
Tue Apr 7 15:49:10 CDT 2015


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
>


More information about the AccessD mailing list