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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add item to combo box in alphabetical order

Status
Not open for further replies.

mstekkie

Technical User
May 15, 2002
51
CA
hello!

i've got this combo box that allows the user to choose an occupation. if the desired occupation is not in the list, the user has the option to add it to the list.

my question is: how can i add that new item to the list in alphabetical order?

thank you in advance!

ms.tekkie
 
The data for the combo should be based on a query with the Job Description being the primary index sorted Ascending.

After you have added the details to the table use a reqeury on the combo to put the new item in it's correct position in the list.

Me.frmJobDetails.cboJobs.Requery

Hope this helps
 
the data for the combo box is based on a table. the table contains the primary key (autonumber) and the occupation name.

right now, the data in the combo box is sorted by primary key in ascending order. is there any way to change it to sort it by occupation name instead of by primary key?

thanks,
ms. tekkie
 
thanks trendsetter,

i got it to work perfectly!

ms.tekkie
 
You can only do what you want to do by using a query not the table!

The data for the combo should be based on a query with the occupation name being the new index sorted Ascending.

If you don't know how to generate a query for a combo come back and I will help
 
hi trendsetter,

i was able to get it to work using the query.

thanks!

ms.tekkie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top