Solved

Custom sort the order of data in report

Posted on 2008-10-13
4
574 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

743 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