472,145 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

Access Sorting problem - please help! (also in comp.databases)

I wonder if you can help me.

I have setup an address-book database in Access XP. I have the first name &
surname as separate fields. As I wanted to sort my database by surname and
then by first name I had surname before first name when I created the
fields of my database..

To do the sort (in table view) I highlighted the two columns (fields), in
this case surname and first name, and selected sort. Access then sorted the
database by surname and then by first name. When I viewed the database in
table view it was sorted exactly the way I wanted it.

However, when I looked at the database in a form it did not show the records
in the order it did in table view, I think the form displayed the records
just sorted by surname.

The reason I want to sort by surname and first name is because sometimes I
have two entries for the same person; 1 address may be home address and the
other a work address.
What I am trying to do is to make sure that records with the same names are
consecutive rather than having other record(s) in between. I have achieved
this in the table view but am struggling to do it in form view
..
Why do the records in form view appear in a different order to how I sorted
them in the table?

How can I make my form display the records in the sorted way I want?

I hope you can help me.

I appreciate any help or information given.

Thanks!

--
-------------------------------------------------------------------------
FIGHT BACK AGAINST SPAM!
Download Spam Inspector, the Award Winning Anti-Spam Filter
http://mail.giantcompany.com


Nov 13 '05 #1
3 3785
"Neil Hindry" <n_nospam_hindry@_nospam_hotmail.com> wrote in message
news:43***********************@news.zen.co.uk...
.
Why do the records in form view appear in a different order to how I
sorted
them in the table?

How can I make my form display the records in the sorted way I want?


By basing your form on a query sorted on the two fields in the right order.

HTH - Keith.
www.keithwilby.com
Nov 13 '05 #2
Neil Hindry wrote:
I wonder if you can help me.

I have setup an address-book database in Access XP. I have the first
name & surname as separate fields. As I wanted to sort my database
by surname and then by first name I had surname before first name
when I created the fields of my database..

To do the sort (in table view) I highlighted the two columns
(fields), in this case surname and first name, and selected sort.
Access then sorted the database by surname and then by first name.
When I viewed the database in table view it was sorted exactly the
way I wanted it.
However, when I looked at the database in a form it did not show the
records in the order it did in table view, I think the form displayed
the records just sorted by surname.

The reason I want to sort by surname and first name is because
sometimes I have two entries for the same person; 1 address may be
home address and the other a work address.
What I am trying to do is to make sure that records with the same
names are consecutive rather than having other record(s) in between.
I have achieved this in the table view but am struggling to do it in
form view .
Why do the records in form view appear in a different order to how I
sorted them in the table?

How can I make my form display the records in the sorted way I want?

I hope you can help me.

I appreciate any help or information given.

Thanks!


You didn't actually "sort the table". When you view a table datasheet directly
Access is actually executing a SELECT query under the covers and showing you the
results. When you apply filters and sorting to that datsheet view it only
affects that GUI view of the datasheet. It has no affect on the actual data as
it is stored on disk and subsequently those settings will not be inherited by
any query, report, or form that later uses the table as a source.

Actually there is one exception to that. If you apply those things to a table
and then use the form wizard to create a form against the table it will inherit
the filters and sorting in the same way that it inherits InputMasks or Format
settings. However; it does this by having those properties *copied* to the
newly created form, not because those settings in the table are "carried over"
to the form. All of those settings can later be changed in the table without
affecting the form and they can be changed in the form without affecting the
table.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #3
The first thing to do is get out of your head the idea that you are sorting
the table, you're not. Think of a table as a bucket of data organised in
records and you have a better idea of what a relational database table is
all about.

You use queries to sort, filter and group data in the way you want to
present it.

In short, use a query as the recordsource for your form, base the query on
your table and sort in the query by the surname and firstname fields.
--
Terry Kreft

"Neil Hindry" <n_nospam_hindry@_nospam_hotmail.com> wrote in message
news:43***********************@news.zen.co.uk...
I wonder if you can help me.

I have setup an address-book database in Access XP. I have the first name
&
surname as separate fields. As I wanted to sort my database by surname
and
then by first name I had surname before first name when I created the
fields of my database..

To do the sort (in table view) I highlighted the two columns (fields), in
this case surname and first name, and selected sort. Access then sorted
the
database by surname and then by first name. When I viewed the database in
table view it was sorted exactly the way I wanted it.

However, when I looked at the database in a form it did not show the
records
in the order it did in table view, I think the form displayed the records
just sorted by surname.

The reason I want to sort by surname and first name is because sometimes I
have two entries for the same person; 1 address may be home address and
the
other a work address.
What I am trying to do is to make sure that records with the same names
are
consecutive rather than having other record(s) in between. I have achieved
this in the table view but am struggling to do it in form view
.
Why do the records in form view appear in a different order to how I
sorted
them in the table?

How can I make my form display the records in the sorted way I want?

I hope you can help me.

I appreciate any help or information given.

Thanks!

--
-------------------------------------------------------------------------
FIGHT BACK AGAINST SPAM!
Download Spam Inspector, the Award Winning Anti-Spam Filter
http://mail.giantcompany.com

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by dont bother | last post: by
3 posts views Thread by Leszek Klich | last post: by
2 posts views Thread by John Pettitt | last post: by
19 posts views Thread by Owen T. Soroke | last post: by
4 posts views Thread by ApexData | last post: by
4 posts views Thread by Ambica Jain | last post: by
2 posts views Thread by mahesh123 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.