Setup Multipule keys in a Table

S

Steve B

Having problem creating multipule key fields in a table.
Need Account#,Date,Amount fields to be considered as one key field.
When I try to set up, get error key contains null value or duplicate.

Data can have null values and duplicates if considered individually but
if all three are treated as one, there are no dups but could have some
blank values.

Once I have unique key field, I need to update with additional records
by importing another text file.
 
D

Douglas J. Steele

You can't use an index as a primary key if any of the fields are Null, but
you can still create a unique index on those fields.

While the table's open in Design view, go to the Indexes dialog (look on the
View menu). Type anyname you like as the Index Name in the first column and
one of the field names in the second column. (You can leave the Sort Order
as the default Ascending). On the next row, leav the Index Name blank, and
type the name of the next field in the second column. Repeat for the third
field. Look in the bottom left-hand corner of the dialog. Leave Primary set
as No, but change Unique to Yes. (leave Ignore Nulls as No so that the Null
fields will be considered in the Index)
 

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