Indexes Collection

See AlsovbobjIndexesCollectionSee           PropertiesvbobjIndexesCollectionProp                  MethodsvbobjIndexesCollectionMth


A collection of Index objects.  An Indexes collection can be found in Table and TableDef objects.


The default collection of a TableDef is the Fields collection.  The default property of an Index is the Name property.  You can simplify your code by taking advantage of these defaults.  For example, using the defaults, the following statements are identical in that they both print the list of field names in an Index with a data control:

Print Data1.Database.TableDefs("Authors").Indexes(0).Fields
Print Data1.Database("Authors").Indexes(0).Fields


Note that the Fields collection of a recordset is not the same as the Fields property of an Index object.

Index objects are stored with a TableDef in a Database, and like a Table and a Field, an Index has a name that is recognized by the Database.  The Name property of an Index object is not the same as the name of an object variable to which it has been assigned.  Unlike forms and controls, the Name property of an Index object is available at run time.

Professional Edition

In the Professional Edition, you can declare an object variableZ3R9Q5 as type Indexes (a collection) or as type Index.