Re: Access Sorting problem - please help! (also in alt.comp.databases)
- From: Bob Hairgrove <invalid@xxxxxxxxxxx>
- Date: Mon, 21 Nov 2005 18:18:22 +0100
On Wed, 9 Nov 2005 12:22:41 -0000, "Neil Hindry"
<n_nospam_hindry@xxxxxxxxxxxxxxxxxxx> wrote:
[some snipped]
>Why do the records in form view appear in a different order to how I sorted
>them in the table?
This is because Access does not store the ordering together with the
table data, but only with the *view* that it gives you of the data by
opening in table view. Like Jim said, think of data in a table as an
unsorted heap or bucket of data. The database engine will store the
data in some way which will make sense only to the engine.
Unfortunately, the sorted table view is of little use to the form
because you might have more than one form to display the same data,
but sorted differently. That's why you need to use a query as the
record source for your form.
>How can I make my form display the records in the sorted way I want?
You have to create a select query with a sort order (an "order by"
clause in SQL) and base the form's record source on that query instead
of on the raw table. If you create the query through the graphical
query designer, there is a sorting option for each column displayed
(ascending, descending, or not sorted). Access will sort the columns
in the order that they appear in the query designer. That can be quite
useful if you need to display first name, then last name, but want to
sort on last name + first name. What you do then is enter the last
name column twice: once before first name, then once again after it.
The first one should not display, so uncheck the "show" box, but set
the sorting to ascending or descending as preferred. Then you would
sort the first name column, but also show it, so the "show" check box
stays checked.
Of course, when you design the form, the column ordering of the query
doesn't matter because you can arrange the controls on the form
anywhere you need them to be.
--
Bob Hairgrove
NoSpamPlease@xxxxxxxx
.
- References:
- Access Sorting problem - please help! (also in alt.comp.databases)
- From: Neil Hindry
- Access Sorting problem - please help! (also in alt.comp.databases)
- Prev by Date: Re: Automatic database request
- Next by Date: Re: what is the different between "oracle" and "mysql"?
- Previous by thread: Re: Access Sorting problem - please help! (also in alt.comp.databases)
- Next by thread: i'm looking for a database
- Index(es):
Relevant Pages
|