Null as Default Value

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?
 
K

Ken Snell \(MVP\)

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.
 
P

Pat Hartman \(MVP\)

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

ixniggle

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.
 
K

Ken Snell \(MVP\)

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".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top