creating a multiple field key index in access 2007

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've searched the kb without an answer. Can somebody help? It's got to be
easy.

dennist685
 
If the fields are contiguous, open the table in design view, select the
multiple fields at once (using the "record Selecter" to the left of the
field name), and click the Key icon on the toolbar.

If the fields are spread apart, or you want the index in a different order,
open the Indexes dialog (View menu, in table design). Enter a name for the
index in the first column, and the first field beside that. On subsequent
lines of the dialog, leave the Index Name column blank (indicating this row
is part of the same index above), and enter the field name. The dialog will
look something like this:
Index Name Field Name Sort Order
========= ======== =======
PrimaryKey CompanyName Ascending
City Ascending
State Ascending

If you wanted to create the index programmatically instead of via the
interface, see these examples:
http://allenbrowne.com/func-DAO.html#CreateIndexesDAO
http://allenbrowne.com/func-ADOX.html#CreateIndexesAdox
 
Thank you kindly Allen for a straightforward to the point answer.

dennis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top