By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,083 Members | 2,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,083 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
"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

P: n/a
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

P: n/a
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.