Form Sorting

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
 
J

John W. Vinson

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.
 
D

Dave

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.
 

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