Null as Default Value

  • Thread starter Thread starter ixniggle
  • Start date Start date
I

ixniggle

I have been using Access for some number of years but I just noticed that
when I create a new text field and set the Default Value to Null (with no
quotes) and the enter a new record the field has the characters Null
entered. When I do the same with a number field the value Null is entered.
When I set the text field Default Value to =Null then the value Null is
entered as expected for new records. Am I missing something here or has it
always done this? Should I just leave the Default Value blank when I want
Null values entered?
 
Leaving the Default Value property empty for a text field will produce a
Null value in that field if no other data entry is made into that field.
 
Defaults should be set at the table level rather than at the form level. At
the table level, you will need to remove the 0 that Access automatically
places as the default for a numeric field. It doesn't offer a default for
other data types so just leave them empty.
 
I ususally leave the Default Value alone but in this case I wanted to make
sure the Default Value was DOCUMENTED as Null (in case I forget). Still
can't figure out why the text string "Null" was entered into the Text
fields.
 
Default Value property is a text data type, so it actually is stored as a
string. When you type NULL, ACCESS thinks you mean the text string "NULL".
 
Back
Top