I am speaking of the indexes that can be created at the
table level in addition to the primary key.
Help.
After specifying the Order in your code, you need to say:
OrderByOn = True
hth
Hugh
>How do sort a form that uses a table as recordsource. I
>type sort criteria in the orderby category on the format
>tab of the form properties. It does not work.
As Hugh says, you need to (in VBA code) set the OrderByOn property of
the form to True. It's not true by default!
>Additionally, I wonder how to use a secondary index that
>was created at the table level. What good are secondary
>indexes?
They make searching and sorting by that field (or that combination of
fields, if it's a multifield index) faster. You don't need to "use"
them - if you create a Query, a Form, or a Report which uses an
indexed field for sorting, the Access query engine will use the index
if it will speed things up (it usually will). Similarly, if you use an
indexed field with a query criterion, it will find the record faster
(often MUCH faster) than a full table scan.
Note that it's perfectly possible, even routine, to base a Form on a
sorted Query. It's still updateable, you don't need anything else to
put the records in order, and it's easy to implement.
John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
>.
>