knowledge76
07-06-2005, 02:49 AM
I have a beginner Question....How can I set an unique Index on a field in a table if all the four fields are using duplicate values?
|
View Full Version : Unique Index knowledge76 07-06-2005, 02:49 AM I have a beginner Question....How can I set an unique Index on a field in a table if all the four fields are using duplicate values? DaveJHPT 07-06-2005, 03:07 AM You can't. Add a new field called ID (or something) of type Autonumber and set it as the primary key. Dave Pat Hartman 07-06-2005, 03:43 PM If you are asking how to make a multi-column unique index, you need to open the indexes dialog for the table (the lightning bolt icon). On the first completely blank row, enter the index name in the first column and select the first field from the next column. Choose ascending or descending. On the next row, leave the index name empty and tab over to the field name column. Choose the next column. Choose ascending or descending. Do the same thing for the third and fourth fields. As long as the index name is empty, Jet understands that a field is part of the previously defined index. Access/Jet supports up to 10 fields in an index or primary key. Dave, although I also recommend using an autonumber as the primary key rather than the multi-field key, the multi-field index is usually required to enforce a business rule and that makes it necessary. DaveJHPT 07-07-2005, 01:55 AM Fair point. I hadn't really realised that was what the OP wanted... Dave |