Solved

Custom sort the order of data in report

Posted on 2008-10-13
4
584 Views
Last Modified: 2013-11-28
I need help with a report that I need to custom sort the order of data in a report.  I cannot use ascending or descending becuase of the order needed.  Here is what I need for the order:

1.  Letter awaiting approval
2. Letter returned, no CPW
3. CPW awaiting approval
4. 30 days to expiration date

Any help will be appreciated.
0
Comment
Question by:csall
  • 2
  • 2
4 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 500 total points
ID: 22708777
In the query of the report, create a Sort field like sort, then specify that is the Sort in the Grouping and Sorting dialog:

MySort: Switch([YourField]= "Letter awaiting approval",1 , [YourField]= "Letter returned, no CPW",2, [YourField]= "CPW awaiting approval", 3, [YourField]= "30 days to expiration date",4)

mx
0
 

Author Comment

by:csall
ID: 22709999
Where is the query do I create the sort field?  I am looking for where to put the code you provided me sot aht I can select it in the sort and grouping dialog box.
0
 

Author Closing Comment

by:csall
ID: 31505785
I had a brain fart.  I put your code into a new field in the Query and put in the correct field name and it works like a charm.  Thank you very much.
Carl
0
 
LVL 75
ID: 22712724
Grading Comments:
I had a brain fart. I put your code into a new field in the Query and put in the correct field name and it works like a charm. Thank you very much.
Carl

You are welcome.

mx
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now