473,406 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to sort records on a form

Hi,

I have a form/subform. There is a priority field and then a case status
field. I want to display records so that it sorts by case status as
"actives" then "on holds" then "completes" and then "cancelled"

Then within those cases it should sort by priority.

I know how to sort ascending and descending on forms.

thanks a lot for your help.

regards
us

Jul 18 '06 #1
3 5914

us******@gmail.com wrote:
Hi,

I have a form/subform. There is a priority field and then a case status
field. I want to display records so that it sorts by case status as
"actives" then "on holds" then "completes" and then "cancelled"

Then within those cases it should sort by priority.

I know how to sort ascending and descending on forms.

thanks a lot for your help.

regards
us
You would have to create a table that would allow you to emulate your
own sort order.
Create a table, say called "tblCaseStatus" with two fields: StatusNum
(long integer, unique, PK), and Status (text). Then your table would
be

StatusNum Status
1 active
2 on hold
3 complete
4 cancelled

Then just join the two tables by status num (you'd have to include it
in your subform's table/recordsource) and then you could just create a
query and include the field in the rowsource for your subform. Then
you can use it to sort.

Jul 18 '06 #2
On 18 Jul 2006 13:42:06 -0700, us******@gmail.com wrote:
>Hi,

I have a form/subform. There is a priority field and then a case status
field. I want to display records so that it sorts by case status as
"actives" then "on holds" then "completes" and then "cancelled"

Then within those cases it should sort by priority.

I know how to sort ascending and descending on forms.

thanks a lot for your help.

regards
us
Add a calculated sort field to your form's recordsource -

SortField:IIF([case status]='active',1,IIF([case status]='on hold',2,IIF([case
status]='complete',3,4)))

Sort on this field first and then the prioity field.

Wayne Gillespie
Gosford NSW Australia
Jul 18 '06 #3
Hello,

All thanks for all your help.

I don't know how to sort on two fields. I only know to sort it on one
field.

regards
us
Wayne Gillespie wrote:
On 18 Jul 2006 13:42:06 -0700, us******@gmail.com wrote:
Hi,

I have a form/subform. There is a priority field and then a case status
field. I want to display records so that it sorts by case status as
"actives" then "on holds" then "completes" and then "cancelled"

Then within those cases it should sort by priority.

I know how to sort ascending and descending on forms.

thanks a lot for your help.

regards
us

Add a calculated sort field to your form's recordsource -

SortField:IIF([case status]='active',1,IIF([case status]='on hold',2,IIF([case
status]='complete',3,4)))

Sort on this field first and then the prioity field.

Wayne Gillespie
Gosford NSW Australia
Jul 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Nova's Taylor | last post by:
Hi folks, I am a newbie to Python and am hoping that someone can get me started on a log parser that I am trying to write. The log is an ASCII file that contains a process identifier (PID),...
4
by: Matt | last post by:
Hi all, We recently upsized two Microsoft Access Databases to SQL. We're using an ADP (2002) as the front end. All the conversion issues have been resolved, except for one: Whenever we...
40
by: Elijah Bailey | last post by:
I want to sort a set of records using STL's sort() function, but dont see an easy way to do it. I have a char *data; which has size mn bytes where m is size of the record and n is the...
2
by: Max Harvey | last post by:
Hi all, I have a form which is based on a table. The table (table1) has fields like Surname, Firstname, etc. I want to have the form sort by Surname, and then Firstname. I put the Orderby...
12
by: MLH | last post by:
I have created two forms: frmBrowseNegsMainform and frmBrowseNegsSubform. I put a subform control on the first of these. The SourceObject property for the subform control is, of course,...
4
by: Nhmiller | last post by:
This is directly from Access' Help: "About designing a query When you open a query in Design view, or open a form, report, or datasheet and show the Advanced Filter/Sort window (Advanced...
6
by: Chris Zoper | last post by:
Hello, I have a form that shows a lot of records based on a passthrough query to a SQL Server database. I noticed that the Filter and the Sort property of the form do not properly work, often...
3
by: Vic Spainhower | last post by:
Hello, I have an HTML table that is being constructed from a MySQL table and displays a form that includes a check box on 1 of the fields on the form for each record. I have included in this PHP...
3
by: sail87 | last post by:
I inherited an Access 2003 database and need to change the way a form is sorted. It seems to work like this. There is a table containing work records of work requests. The user fills out a form...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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...
0
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...

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.