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

alphabetical sort in access form

Status
Not open for further replies.

becshu

Technical User
Jan 28, 2003
18
US
Hi,
I am trying to create a userform that would go through my database based on a field sorted alphabetically. It is currently moving through the database based on the index number. How do I fix this? I would also like to create a combobox in a form that lists entries alphabetically. I can do this easily in excel, but don't understand how to do it in access.
Thanks!
 
To sort your database alphabetically, just place your cursor in the field you want sorted, click the AtoZ button in the toolbar and save.
 
Open your form in design view then open the Properties window. Click the Data tab and type your field name in the Order By box.

To sort items in your combo box you can either base it on a query that's sorted or specify your sort in the Row Source (click the Data tab on the form's Properties window). For example: SELECT [tblWOStatus].[WOStatusID], [tblWOStatus].[WOStatus] FROM tblWOStatus ORDER BY [WOStatus]; Ann
 
That worked for the combo box, thank you.
However, I set the Order By property for the form and it is still not selecting records in alphabetical order. Is there something else I'm missing?
 
If your form is based on a table rather than on a query type YourTableName.YourFieldName in the Order By box. Ann
 
My form is based on a table. I tried putting mytable.myfield in the order by box and this did not work. I realize there must be a very easy solution and it's driving me crazy. The field is indexed. Could this be the problem??
 
Oh, boy. Indexing should not be causing this. Double check your typing and make sure you've got the period between YourTableName and YourFieldName. Also, verify that the Record Source box shows YourTableName. Ann
 
Click on the combo box in design view,

list properties >> click data tab >> click the '...' button on the rowsource line >> the query wizard starts >> click on the sort line for the field you wish to sort by and select ascending.

job done. This requires that you have set the combo box up already
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top