Select an different index for a form

  • Thread starter Thread starter Ed Cones
  • Start date Start date
E

Ed Cones

This should be so simple, but I've struck out.

A table has multiple indexes, but it always uses one of them for every form.
I'd like to display the data in varying order depending on the use of the
form, so how do I tell the form what index to use?

thx
 
Try using the OrderBy property of the form. Alternately, you can change the
sort order of the form's record source. This would be best done by using a
query rather than a table as the form's record source.
 
I'm not being flippant here -- just trying to learn something. But why is
there a way to do multiple indexes if there's no good way to select them? I
was hoping to use one form and let the user select the order they want based
on their own needs.

Bear in mind that I'm an old xBase programmer just trying to learn.

Thanks for the helpful answer.
 
I spent many years with DbaseIII, Foxbase, and FoxPro, so I know what you
mean. In Access it is a bit more subtle. When you set an order on a field
or combination of fields, you should first identify that as an index in table
design. Access will use the index without you having to explicitly set it.
It is sort of like in Access, you define your relationships in the
Relationship window, but as you remember, in xBase, you had to explicitly SET
RELATION TO.
 
I was a Clipper guy and can't help still trying to think that way. So,
creating an index in table design doesn't give me the ability to select that
index by name, just use that order. Is that sort of correct?
 
Yes, your understanding is basically correct.

An index allows sorts and searches to occur more rapidly on the field that is
indexed. The query uses an index (if it exists) when you use a field and
search against that field, use the field in a join, or order by the field.

An index is also used (I believe) when you use a form's filter or order
properties.

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 
Back
Top