DATA NOT DUPLICATE WITHIN THE SAME PRIMARY KEY

  • Follow


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?

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200704/1

0
Reply EMILYTAN 4/13/2007 7:17:23 AM

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



"EMILYTAN via AccessMonster.com" <u33296@uwe> wrote in message 
news:70a15fbed0e64@uwe...
> 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?
>
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200704/1
> 


0
Reply Michel 4/13/2007 2:01:39 PM


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 Walsh wrote:
>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?

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200704/1

0
Reply EMILYTAN 4/16/2007 8:15:21 AM

2 Replies
159 Views

(page loaded in 0.014 seconds)

Similiar Articles:
















7/22/2012 3:49:24 PM


Reply: