No duplicates in 2 columns

W

Weezie1383

Greetings all,

I'm sure this is very easy, but I'm having trouble using the right syntax. I
have a table with 2 fields, both of which are look-ups to fields in other
tables. I simply want to make sure that the same information is not
accidently entered in twice in my table.

Eg. If Column 1 -Object
Column 2 - Colour

Column 1 Column 2
Ball Red
Cube Red
Ball Blue
Ball Blue <- Not allowed


I would also like it to pop-up with a little message which says that this
item has already been registered and allow my users to try again.

Thank you!!
 
T

Tom Lake

Weezie1383 said:
Greetings all,

I'm sure this is very easy, but I'm having trouble using the right syntax.
I
have a table with 2 fields, both of which are look-ups to fields in other
tables. I simply want to make sure that the same information is not
accidently entered in twice in my table.

Eg. If Column 1 -Object
Column 2 - Colour

Create a compound unique index consisting of Object and Colour.

In the Index screen, include rows for both Object and Colour but only
put an entry for Index Name in the first row. Both indices will be
treated as a single index.

Tom Lake
 
K

KARL DEWEY

Create a compound index.
Open the table in design view, click on menu VIEW - Indexes. Enter a name
for an index, select your two fields. Click on the first field of the index
and an inset window opens. Set Unique to Yes. You may want to ignore nulls
or not.
 

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