Access97 and composite unique indexes

  • Thread starter Thread starter Jonathan Scott via AccessMonster.com
  • Start date Start date
J

Jonathan Scott via AccessMonster.com

I am trying to put a unique constraint on three fields of a table, but in
the Index dialog it complains that I have three rows with the same name.
So, when I try to enter three column names on one line, it says there is
not such column.

Does Access97 not support composite unique indexes?

Jonathan Scott
 
Jonathan said:
I am trying to put a unique constraint on three fields of a table,
but in the Index dialog it complains that I have three rows with the
same name. So, when I try to enter three column names on one line, it
says there is not such column.

Does Access97 not support composite unique indexes?

Jonathan Scott

You entry in the index form should look like...

IndexName Field1
Field2
Field3
 
I am trying to put a unique constraint on three fields of a table, but in
the Index dialog it complains that I have three rows with the same name.
So, when I try to enter three column names on one line, it says there is
not such column.

Does Access97 not support composite unique indexes?

Yes (for up to ten fields), but it's not instantly obvious how to set
one up.

Open the Indexes dialog (click the lightning-bolt-hitting-a-datasheet
idon). Enter a unique index name in the left column. Put the first
field in the right column across from the index name; the next field
in the right column in the next row down; and the third field one row
further down yet. It'll look something like

MyUniqueIndex FirstField
SecondField
ThirdField
SomeOtherIndex anotherfield

Check the "unique index" checkbox with the first row selected.

John W. Vinson[MVP]
 
Many thanks to the both of you. I now understand it. ;)

Jonathan Scott
 
Back
Top