?
Solved

Custom sort the order of data in report

Posted on 2008-10-13
4
Medium Priority
?
624 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

719 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