combobox data not sorted (1 Viewer)

moose

c'mon Chelsea
Local time
Today, 17:45
Joined
May 18, 2001
Messages
139
:confused: on my form i have a combobox which gets its data from customer in tblcustomer. in the table the customer field id sorted alphabetically by customer name but somehow in the combo box it is not sorted. it was this morning but somehow it has lost the sort. can anyone help please :confused:

Thanks in advance
 

ColinEssex

Old registered user
Local time
Today, 17:45
Joined
Feb 22, 2002
Messages
9,132
In the comboBox properties click on RowSource and the little grey square ...
That'll get you to the query grid of the combo, sort the data there

Col
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 11:45
Joined
Feb 28, 2001
Messages
27,322
If the data appears to have lost the sort, I would have to assume that the customer name isn't the primary key. Otherwise, this could NEVER happen.

The sure-fire way to prevent this for a non-primary key field is to build a query that sorts on that field. Then build your combo box from the query, not the table. (Shortens the amount of data you have to consider, too.)
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:45
Joined
Feb 19, 2002
Messages
43,486
Tables are unordered sets of data. Therefore, the ONLY way to ensure a particular sequence is to use a query with an ORDER BY clause. When you open a table in datasheet view, Access runs a query behind the scenes and uses the table's primary key in its ORDER BY clause. This fools people into thinking that the data is actually stored in some meaningful order.
 

moose

c'mon Chelsea
Local time
Today, 17:45
Joined
May 18, 2001
Messages
139
thanks for all your help. job done!!!;) ;) ;) ;) ;)
 

Users who are viewing this thread

Top Bottom