04 CreateIndex - AndrewMB2/Logic-Architect-for-Excel-VBA GitHub Wiki
CreateIndex method
Creates an index.
Applies to
| TableData | ArrData | RsetData | Xdata | XShared |
|---|---|---|---|---|
| ✓ | ✓ | ✓ |
Parameters
| Name | Type | Description |
|---|---|---|
| Fields | Value, Array or ParamArray | List of fields to be indexed. |
TableData and ArrData support indexing to enable records to be easily located. RsetData does not support indexing, though CreateIndex is supported for Xdata objects provided they are of type TableData or ArrData. The index can be on any number of fields and it is possible for multiple records to have the same set of key values.
Tabledata indexes are maintained across most maintenance operations (though not operations such as Sort which make bulk changes). ArrData indexes are not maintained and must be recreated after any data changes.
TableData indexes ignore empty records. ArrData indexes include empty records.
On ArrData, the IndexMultiple property can be set to allow or not allow multiple records with the same key. The default is to allow multiple records.