Change Default Number

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

Guest

Does anyone know if you can change the default of the default value for a
number field from 0 to null?

Cheers

Rico
 
Dear rico:

When you create a number field in Access, the field is given the default
value of "0". Ensure that the default value setting for the field is blank,
and then any new records will have a null value in that field. You change
this value in the table design view. If you need help to do this, post back!

Please note that this will only affect *new* records, it will not modify the
existing values in the table. For that you would use an update query.

HTH
Fred Boer
 
Sorry did not explain myself properly.

I am creating tables will lots of number fields and its just very annoying
having to change 50 to 100 fields default value from 0 to null. Was just
wondering if like with a number fields default format, you could change what
it defaults to each time you create a new field.
 
Dear rico:

Ah, well, yes, that is a different question. :)

As far as I know, there is no way to make Access use a Null for number
fields as the default. You could use code to programatically loop through
all of your tables and set this value once you have finished creating all of
the tables.

HTH
Fred Boer
 
Fred said:
As far as I know, there is no way to make Access use a Null for number
fields as the default.

Try this in the SQL view of a Query:

CREATE TABLE Test (Col1 INTEGER, Col2 INTEGER, Col3 INTEGER);

Jamie.

--
 

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

Back
Top