Defining a Sort By rule

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
 
J

Jacob Frankham

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
 
J

Jim/Chris

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
 
J

Jacob Frankham

Thankd for that

I thought it would be straightforward !!

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

Thanks again

Jake
 
M

Marshall Barton

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' "
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top