Reputation: 139
I'm building a database for my company in ms-access and now have a "Clients" table and a "Projects" table. I have set the clients table to only accept unique values and I would like to restrict the projects in the same way, but different projects CAN have the same name, just not if there are with the same client. I have already set up relationship between my tables, is there a way to restrict projet entries to be unique "only if projet client is the same"?
Upvotes: 0
Views: 62
Reputation: 3501
Add the ClientID column to your Projects table. Create a unique index on the Projects table with both the ClientID and Project Name in it.
Upvotes: 1