No duplicates question

C

cinnie

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?
 
J

John Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top