473,570 Members | 2,914 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 4023
"Neil Hindry" <n_nospam_hindr y@_nospam_hotma il.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_hindr y@_nospam_hotma il.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
2523
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() sorted_feature_vector.sort() #feature_vector.keys()=sorted_feature_vector
3
5738
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. Sorting must visualise (preview) process in list. Any method of sorting. I do not want to use stantard methods including to QT. I have ready: (main...
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 Descending order. Please Help.
8
3498
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 the moment the printed output is usually going to Word. It's turning into an unholy mess, because I'm having to prepare umpteen different Word...
24
2759
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> But I am curious about what techniques those of you who have done higher volume access implementations use to ensure high performance of the...
19
25441
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 sort columns based on the column header the user has clicked in both Ascending and Descending formats.
4
4598
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. Ex. REPAIR=True, MAINT=False, BATTERY=True I want to generate ONE report that lists all the REPAIRS, then lists all the MAINT, and then lists all...
4
3089
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 grid. And with rebinding, sorting image (little triangle on the column header) goes away. I need to show sorting image as well custom sorting. Please...
1
3865
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 value gets No. 1, and then the row of the second biggest value is ranked as No. 2). Each task owners will then have to attack their owning issues...
2
1360
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 Server Error in '/' Application. -------------------------------------------------------------------------------- The data source...
0
7726
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7948
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7700
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5523
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5247
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3682
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3671
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
971
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.