Defining a Sort By rule

  • Thread starter Thread starter Jacob Frankham
  • Start date Start date
J

Jacob Frankham

Hi

I have a field called RISK which takes one of three values :

High, Medium, Low

I am grouping on my report by RISK, but am only given the option of ordering
by 'Ascending' or 'Descending' and what I actually want to do is group in
this order:

High
Medium
Low

which is not alphabetical

Someone told me to create a table and sort on a numeric field, but I am a
bit of a novice and would appreciate some guidance on how to actually do
this

Many thanks

Jake
 
Sorry, I forgot to mention:

RISK could also possibly be of the value "Advisory", but I do not want the
report to show these.
I cannot restrict "Advisory" out of the query itself as this query is used
in other reports which need "Advisory".

So in summary, what I need to know is how to

a) Force sort the grouping into the order 'High', 'Medium', 'Low'
b) Eliminate "Advisory" records from report (but not from query)

Thanks everyone

Jake
 
Create a table with two fields "value" and "sortValue"
High, Medium and Low would be stored in our value field
and 1, 2 or 3 would be stored in your sortvalue field.
Add this table to your report query and sort by sortvalue
filed.

Jim
 
Thankd for that

I thought it would be straightforward !!

But what about my other question, re eliminating "Advisory" - any ideas?

Thanks again

Jake
 
Jacob said:
RISK could also possibly be of the value "Advisory", but I do not want the
report to show these.
I cannot restrict "Advisory" out of the query itself as this query is used
in other reports which need "Advisory".

So in summary, what I need to know is how to

a) Force sort the grouping into the order 'High', 'Medium', 'Low'
b) Eliminate "Advisory" records from report (but not from query)

How are you opening the report? If it's in a form button's
click event, then you can use the OpenReport method's
WhereCondition argument to filter out those records:

DoCmd.OpenReport "reportname", acViewPreview, _
WhereCondition:= "RISK <> 'Advisory' "
 
Back
Top