Item order in combo box

G

Guest

Greetings:

I'm creating an application to input information on soldiers in my unit.

On the form I created to input the information, I created a combo box
for the user to enter the soldier's rank. The source of this combo box is
a single column table I created, called Ranks, that lists the ranks found
in my unit.

Now when the user clicks on the dropdown arrow, I'd like the ranks listed
in order of importance, e.g:

PVT, PV2, PFC, SPC, CPL, SGT, SSG, SFC, MSG, 1SG, 2LT, 1LT, CPT, MAJ,
LTC, COL

But instead, the ranks are listed in alphabetical order, e,g:

1LT, 1SG, 2LT, CPL, CPT, LTC, ....

Can somebody tell me how to fix this? Is there some way of telling
the combo box to list the items in the same order the are defined in
the table instead of alphabetical order?

Respectfully,

Charles Ritz
 
A

Arvin Meyer [MVP]

Hi Charles,

Thanks for being there for us.

To answer your question: Add a sorting column to the table that contains the
ranks. Then the Select statement for the combo box might look something
like:

Select Rank From tblRanks Order By Sortfield;

You need not display the sortfield, just include it in the Select statement
or query.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
G

Guest

Thanks Arvin. It worked perfectly.

Arvin Meyer said:
Hi Charles,

Thanks for being there for us.

To answer your question: Add a sorting column to the table that contains the
ranks. Then the Select statement for the combo box might look something
like:

Select Rank From tblRanks Order By Sortfield;

You need not display the sortfield, just include it in the Select statement
or query.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 

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