Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FORMS - format, orderby property

0 views
Skip to first unread message

Patricia R. Turner

unread,
Mar 4, 2003, 8:41:10 PM3/4/03
to
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.
Additionally, I wonder how to use a secondary index that
was created at the table level. What good are secondary
indexes?

I am speaking of the indexes that can be created at the
table level in addition to the primary key.

Help.

Hugh O'Neill

unread,
Mar 4, 2003, 9:21:34 PM3/4/03
to
In article <02ef01c2e2b8$4c3e0cf0$a401...@phx.gbl>, p3r_...@msn.com
says...

After specifying the Order in your code, you need to say:

OrderByOn = True

hth

Hugh

John Vinson

unread,
Mar 5, 2003, 12:14:51 AM3/5/03
to
On Tue, 4 Mar 2003 17:41:10 -0800, "Patricia R. Turner"
<p3r_...@msn.com> wrote:

>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

ere...@netscape.net

unread,
Mar 5, 2003, 6:58:44 AM3/5/03
to
HI THERE
the way i use to sort the records (if the order by doesnt
work directly) is:
change the record source of the form from, say: "tblName"
to "Select * From tblName Order By Field1"
this always works (and even puts the "order by" field in
it's place in the property page)
for your other question, index should be created for any
field you think (or know) you're gonna need to find or
sort records by.
it just makes looking up the values in that field much
faster (just like finding a word using an index of a book
is faster than finding it by reading the whole book)
Erez.

>.
>

0 new messages