473,500 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4008
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2515
by: dont bother | last post by:
This is really driving me crazy. I have a dictionary feature_vectors{}. I try to sort its keys using #apply sorting on feature_vectors sorted_feature_vector=feature_vectors.keys()...
3
5731
by: Leszek Klich | last post by:
Hello All ! I have a task: QT library: List ListBox. I generating n random numbers from range 0 to 100. I have to sort it by hand... It has to look nicely. It's my workhome from my school....
2
453
by: John Pettitt | last post by:
I have designed a Dbase,& I cant get all the Reports or some queries to Print Monthly Summaries in Monthly date order. The date is the first column & sorts alphabetically either Ascending or...
8
3485
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
24
2736
by: Bob Alston | last post by:
Most of my Access database implementations have been fairly small in terms of data volume and number of concurrent users. So far I haven't had performance issues to worry about. <knock on wood> ...
19
25423
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to...
4
4595
by: ApexData | last post by:
I have one table used to maintain information on Service Events. Each record contains a Repair, Maint, and Battery checkbox (bound/boolean). Any one of these fields may be checked or left empty....
4
3081
by: Ambica Jain | last post by:
Hi, I want custom sorting on some of the columns in the datagrid. And i am able to do the same by overriding MouseDown event. However, i need to rebind my datatable to reflect the changes in...
1
3855
by: jjjoic | last post by:
Hi, I use Access 2003 to generate the back-end data for a ColdFusion report at work. The report is sorted by a column and based on the sorting, rankings are assigned to each row(i.e. the biggest...
2
1354
by: mahesh123 | last post by:
Hi, I am using gridview in my form and binded the gridview with object datasource.I am trying to implement sorting for my grid view and i am getting following error.i am using asp.net with VB ...
0
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7397
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4923
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.