DATA NOT DUPLICATE WITHIN THE SAME PRIMARY KEY

  • Thread starter EMILYTAN via AccessMonster.com
  • Start date
E

EMILYTAN via AccessMonster.com

How to make the data not duplicate within that particular primary key within
the same table?
For example, a table has the job number as the primary key and the item
number as the normal data (not primary key). This means a job can have
various item and not duplicate item but the item will be duplicate within
each different new job? How?
 
M

Michel Walsh

Add an index built on TWO columns, and mark that index as being unique.

To build an index on TWO columns, in the table design, have the Index sheet
(form) visible, give a name to your new index (first column), give one of
the field in the second column, change row, DON'T TYPE a name in the first
column, and, in the second column, add the second field.

Click on the first row (defining the index) and have the Unique option set
to yes (it is a line near the bottom of the Indexes sheet).


In your case, that index is likely to have project and item, for its two
fields. You will be able to have two items =1, but NOT in the same project.


Hoping it may help,
Vanderghast, Access MVP
 
E

EMILYTAN via AccessMonster.com

wow great!
but can you explain with me step by step from scratch if you dont mind...
It is ok if you can't...
Thanks for helping...


Michel said:
Add an index built on TWO columns, and mark that index as being unique.

To build an index on TWO columns, in the table design, have the Index sheet
(form) visible, give a name to your new index (first column), give one of
the field in the second column, change row, DON'T TYPE a name in the first
column, and, in the second column, add the second field.

Click on the first row (defining the index) and have the Unique option set
to yes (it is a line near the bottom of the Indexes sheet).

In your case, that index is likely to have project and item, for its two
fields. You will be able to have two items =1, but NOT in the same project.

Hoping it may help,
Vanderghast, Access MVP
How to make the data not duplicate within that particular primary key
within
[quoted text clipped - 3 lines]
various item and not duplicate item but the item will be duplicate within
each different new job? How?
 

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