rdemyan via AccessMonster.com wrote:
I have a table with about 80 fields. I'm using an import process to
populate the table. It works fine, except for the following:
Users generally don't specify values for a lot of numerical fields on
the spreadsheet. I set the Access table up so that all the numerical
values would have a default value of zero.
I thought that when the record was appended to the table that the
numerical fields that do not have values would be defaulted to zero
by Access. This is not happening. The field values show nothing in
the table.
How do I get Access to default these blank values to zero in the
table using my import process.
Thanks.
A default is not applied when you append a row with a null in that field. The
default is applied when you append a row that does not include that field at
all.
For example: If I have a table with two fields [ID] and [SomeNumber] and
[SomeNumber] has a default value of zero then these are the results I will get
from two different append queries...
INSERT INTO TableName
VALUES(1, Null)
result: [ID]=1 SomeNumber = Null
INSERT INTO TableName
VALUES(1)
result: [ID] = 1 SomeNumber = 0
So as long as your Excel import includes all fields then your defaults will
never be applied.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com