?
Solved

Unique Constrains using composite key

Posted on 2003-03-31
2
Medium Priority
?
204 Views
Last Modified: 2006-11-17
Hello!
I would like to know if anybody can help me with this.
I am trying to implement an unique constrains using composite key(two columns)
in Access 2000.
For Eg. I have a table called UserItem with Columns UserId and ItemId.
And the Relation between these two entities is many-to-many.
So in the table UserItem the combination of UserId and ItemId should be unique.
I do not know how to implement this composite key unique constrains in the Access table.

Any help is greatly appreciated.

Thanks in advance.

Vick
0
Comment
Question by:vipulaye
2 Comments
 
LVL 6

Accepted Solution

by:
TheAmigo earned 500 total points
ID: 8240353
In the table design view, you can select both fields UserID and ItemID, then clik on the primary key button in the toolbar.
0
 
LVL 18

Expert Comment

by:1William
ID: 9247413
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept question, points to TheAmigo
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

1William
EE Cleanup Volunteer
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question