Indexing Data

Although not a method of manipulating data like a sort or a filter, indexes provide a method for speeding up searches, sorts, and filters by cataloging the contents of a particular field. The primary key field in a table is automatically indexed. If you have a large database table and frequently search, sort , or filter by a field other than the primary key field, you might want to create an index for that field.

graphics/cation_icon.gif

Can't Be Indexed You can't index a field whose data type is Memo, Hyperlink, or OLE Object. There is no way for Access to verify the content of fields containing these types of entries, making it impossible to create an index.


To index a field, follow these steps:

  1. Open the table in Design view.

  2. Select the field that you want to index.

  3. In the Field Properties pane on the General tab, click in the Indexed box.

  4. From the Indexed field's drop-down list, select either Yes (Duplicates OK) or Yes (No Duplicates) , depending on whether that field's content should be unique for each record (see Figure 14.5). For example, in the case of indexing a last name field, you would want to allow duplicates (Duplicates OK), but in the case of a Social Security number field where you know each entry is unique, you would not want to allow duplicates (No Duplicates).

    Figure 14.5. To index a field, set its Indexed value to one of the Yes choices.

    graphics/86fig05.jpg

  5. Save your changes to the table's structure by clicking the Save button on the Design toolbar.

  6. Close the Design view of the table.

Indexes aren't glamorous. They work behind the scenes to speed up your searches and filters. They don't really have any independent functions of their own.



Microsoft Office 2003 All-in-One
Microsoft Office 2003 All-in-One
ISBN: B005HKSHB2
EAN: N/A
Year: 2002
Pages: 660
Authors: Joe Habraken

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net