Duplicate Values in the index, primary key or relationship

  • Thread starter Thread starter Gregc.
  • Start date Start date
G

Gregc.

G'day

I'm trying to use the commitement line item as the primary key, but
there are a number of duplicates (ie the same line is used for each
cost centre). When I try to do that the following message appears "The
changes you requested to the table were not successfuly because they
would create duplicate values in the index, primary key, or
relationship".

Is there anyway I can get around this,

Greg
 
tina said:
yes - don't use that field as the table's primary key.

So how would I design a query whereby all the values line of for a
commitment line item for a cost centre.

Greg
 
You can create a compound primary key that includes up to 10 columns.
1. Select the first "key" column and while holding the Ctrl key, select the
other fields.
2. When all are selected, press the key icon on the toolbar.
3. Primary keys do not allow nulls and that means that NONE of its
individual fields may be null. If you may have null values, you can't use a
compound PK. You'll need to create a unique index instead and use an
autonumber as the primary key. To create a compound index, you can save
keystrokes by starting as if you are making a pk. When you press the key
icon and open the dialog, change the name "PrimaryKey" to "MyUniqueIndex" or
whatever. Then uncheck the box that says it is the primary key.
 
Back
Top