Default Value "Error#"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Masters of Microsoft Access,

I seem to get an error "ERROR#", when a field is empty where an unbound
field or bound field in DEFAULT requires the "empty" field.

So logically, I tried putting IIF statements to catch the NULL fields - but
this doesn't seem to work. I use the standard statement in the DEFAULT
section:

=IIF(Field=NULL, Null, .......)
and I have tried
=IIF(Field="", "", .......)

Most of these fields are numeric or date/time format.

Does anyone know what to do?
Cowji
 
Default Value is not going to work with an expression like that.

The default value only applies when a new record is being created. At that
time, the fields don't have a value, so testing for a value is not going to
be productive.

In other cases, you would need to use:
=IIf([Field] Is Null), ...
since nothing ever equals null. Explanation:
http://allenbrowne.com/casu-12.html
 
Thanks, I can't believe I didn't think of that

Allen Browne said:
Default Value is not going to work with an expression like that.

The default value only applies when a new record is being created. At that
time, the fields don't have a value, so testing for a value is not going to
be productive.

In other cases, you would need to use:
=IIf([Field] Is Null), ...
since nothing ever equals null. Explanation:
http://allenbrowne.com/casu-12.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Cowji said:
Masters of Microsoft Access,

I seem to get an error "ERROR#", when a field is empty where an unbound
field or bound field in DEFAULT requires the "empty" field.

So logically, I tried putting IIF statements to catch the NULL fields -
but
this doesn't seem to work. I use the standard statement in the DEFAULT
section:

=IIF(Field=NULL, Null, .......)
and I have tried
=IIF(Field="", "", .......)

Most of these fields are numeric or date/time format.

Does anyone know what to do?
Cowji
 
Back
Top