Re: No duplicates question

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Yes,
Create a unique index on BCD

-- Open the table in design view
-- Select View: Indexes from the menu
-- Enter a name for the index on the first blank row
-- Select field B
-- Check Unique (in the bottom of the dialog)
-- Select field C on the next row (don't assign a name for the index - you already did that)
-- Select field D on the next row
Close and save the table

This index should solve your problem.

You could also uncheck A as the PK and make the other 3 columns the PK. You would need to make an index on A that was unique, but you could do that in the graphic interface.

---
John Spencer
Access MVP 2001-2005, 2007


cinnie wrote:
hi

I didn't see a Tables forum, so I'll ask my question here. My table has 4 columns(here called A, B, C, D) A is an autonumber PK. B, C, D are text fields. Here's my problem - I can have duplicates in B or C or D, but I can't allow any matching BCD combinations. I could consider BCD as a triple PK, but I need to keep A as another PK. It is used by other forms, etc. Is there a good way to ensure I don't get duplicates of BCD?
.