[AccessD] Null in table and code

Stuart McLachlan stuart at lexacorp.com.pg
Tue Apr 7 17:33:28 CDT 2015


And edit the table design so that the default value for that field is 0 to avoid simnilar problems 
in future


On 7 Apr 2015 at 13:49, Charlotte Foust wrote:

> 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