Combo box not sorting

texasalynn

Registered User.
Local time
Today, 05:50
Joined
May 30, 2002
Messages
47
I have a form with a combo box which is from a table. The table is sorted by the field used in the combo box, but whenever I click on the combo box the data is not sorted. How can I make this sort? :(


Thanks . . . texasalynn
 
Post the RowSource of your combobox.

It should be something like:

SELECT aField FROM tblYourTable ORDER BY aField;
 
Or in addition to Mile-O's answer.

Put the curser in the RowSource of the ComboBox and you will see a little grey square at the right hand end with 3 dots on it ...

Click on the 3 dots and you'll get the query behind the ComboBox, you can sort there as per a normal query.

Col
 
Open the form in design view, right click the combo box and select properties. In the properties list select Row Source. Click the build button, this displays the query design view of the SQL statement. Under the field you want, change the Sort to ascending or descending. Close the SQL statement window and click yes.

Or you can add Order By to the end of the existing statement. SELECT some stuff FROM table name ORDER BY
.[field];

After Order By it's the table which is the source and the field you want sorted.
 
In the properties of your combo box, go to the rowsource and click the build button. This should take you to the the query screen that builds the SQL behind the combo box.

Just sort on the required field.

HTH
Rob
 

Users who are viewing this thread

Back
Top Bottom