Sorting by a Status Field (combo box) on a Form

S

ssignore

Hello, MS Online Community!
I've just bought a VBA for the Absolute Beginner, so I'm still very green on
Access VBA programming, but was looking for a way to ensure a sort order on a
form according to one of the form's fields.

My frm_Projects has, as its source, qry_Projects. There is a parameter on
qry_Projects which prompts for Analyst Name. Once you enter your name, your
records from the tbl_Projects appear (on which qry_Projects is based.)

If I have 20 separate projects, I'd like to see those that are "In Progress"
first, instead of having to click "next" to go through all 20.
Interestingly, frm_Projects seems to have put its own sort on the Status
field by alpha (Z-A) so that "Pending" will appear first, "On Hold", next,
then "Not Started", before I see "In Progress" .

Can anyone send suggestions on how to reverse this sort order either by VB
or another alternative?

Many thanks!
Simone
 
K

KARL DEWEY

Create a status table with two fields - sort order, number; status, text.
Then you can asign a number to order you desire.
 
S

ssignore

Thank you, Karl! I did get a bit sidetracked thinking I would need to put in
a SQL statement in the "Order By" line on Form Properties, but realized as
long as sort order for Status was in ascending order on qry_Projects,
frm_Projects follows suit.
Much appreciated,
S
 

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