By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,828 Members | 2,241 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,828 IT Pros & Developers. It's quick & easy.

Multple Key Fields

P: 44
How do you define fields so that duplicates aren't allowed based on a combination of two or more fields, but it's ok to have duplicates in any one of the fields? So for example:

Permit Number is a field and Amendment Number is a field in the Amendment table. There can be no duplicates of the Permit Number in the Permits table - that's no problem.

But in the amendment table I can have amendment nos 1,2 and 3 for Permit number 1 and amendment nos 1,2 and 3 for permit number 2, etc., but of course I can't repeat the same amendment number for any one permit.

It seems like all I can do is allow duplicates or disallow them for each specific field, rather than a group of fields. I know there has to be an easy way, but I can't seem to figure it out.

Thanks.
Oct 28 '08 #1
Share this Question
Share on Google+
2 Replies


P: 93
Hi

It looks like you need joined primary key on two fields or you can achieve the same using 'indexes' button in table design view just specify index name (once) + unique property set to yes and include index fields (your 2 fields)

I Hope it helps
Emil
Oct 28 '08 #2

P: 44
Hi

It looks like you need joined primary key on two fields or you can achieve the same using 'indexes' button in table design view just specify index name (once) + unique property set to yes and include index fields (your 2 fields)

I Hope it helps
Emil
Thanks.
Oddly, that's (the first way) what I was doing, but it wouldn't work. I deleted the table and started from scratch and it worked fine.
Oct 28 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.