Form Sorting

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Access 2003

I have a Continuous form that I want to display with records sorted on a
field called [priority].
The form is populated from a query.
The Field [Priority] is a drop down of 4 values (value list) Urgent, High,
Medium, low
I want to be able to have the form put the urgent records on the top of the
list and the low records at the bottom of the list. But the field values are
not alphabetical.

Is there any easy way to do this?

Thanks
Dave
 
Access 2003

I have a Continuous form that I want to display with records sorted on a
field called [priority].
The form is populated from a query.
The Field [Priority] is a drop down of 4 values (value list) Urgent, High,
Medium, low
I want to be able to have the form put the urgent records on the top of the
list and the low records at the bottom of the list. But the field values are
not alphabetical.

Is there any easy way to do this?

One way (of several) would be to put a calculated field in the query:

SortKey: Switch([Priority] = "Urgent", 4, [Priority] = "High", 3, [Priority] =
"Medium", 2, [Priority] = "Low", 1, True, 0)

and sort ascending by this field.
 
Exactly what I needed.

Thank you

Dave

John W. Vinson said:
Access 2003

I have a Continuous form that I want to display with records sorted on a
field called [priority].
The form is populated from a query.
The Field [Priority] is a drop down of 4 values (value list) Urgent, High,
Medium, low
I want to be able to have the form put the urgent records on the top of
the
list and the low records at the bottom of the list. But the field values
are
not alphabetical.

Is there any easy way to do this?

One way (of several) would be to put a calculated field in the query:

SortKey: Switch([Priority] = "Urgent", 4, [Priority] = "High", 3,
[Priority] =
"Medium", 2, [Priority] = "Low", 1, True, 0)

and sort ascending by this field.
 
Back
Top