Unique property
Applies to: Access 2013 | Access 2016
Use the Unique property to specify that an index enforces uniqueness of the data in the table's key index.
Setting
The Unique property uses the following settings.
Setting | Visual Basic | Description |
---|---|---|
Yes | True (-1) | The index is a key (unique) index. |
No | False (0) | The index is a non-key index. |
You can set this property in the Indexes window of table Design view or by using Visual Basic.
Note
To access the Unique property of an index by using Visual Basic, use the ADO Unique property.
Remarks
A key index optimizes finding records. It consists of one or more fields that uniquely arrange all records in a table in a predefined order. If the index consists of one field, values in that field must be unique. If the index consists of more than one field, duplicate values can occur in each field, but each combination of values from all the indexed fields must be unique. A non-key index has fields with values that are not necessarily unique.
An index is the primary index for a table if its Primary property is set to Yes. Each table can have only one primary index.
See also
- Access for developers forum
- Access help on support.office.com
- Access help on answers.microsoft.com
- Access forums on UtterAccess
- Access developer and VBA programming help center (FMS)
- Access posts on StackOverflow
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for