Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting A Combo Box

Status
Not open for further replies.

rss01

Technical User
Oct 10, 2001
125
US
Any ideas on how to sort the data in a combo box ascending?
 
Hi,

You should be able to sort the info. in a combo box by setting up the combo box choices in a two field table. Enter the information you want sorted as the first field and make the other field a field of type number - Let's say the "sort" field. Make sort field the primary key. When you enter the info. it can be in any order, you will need to enter a number in the sort field as you are entering records. (Just so it has a unique number at this point)

When all records are in the table, go back and number the records by using the number field. It is easiest if you start at a high number and number up, say 100, 101, 102 and so on. Since the database will sort a primary key field automatically it will be sorted in the order you number the fields.
 
Hi!

Most people sort combo boxes by using the Order By clause in the query the RowSource is based on.

hth Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top