A combobox sort

E-D

Registered User.
Local time
Today, 17:40
Joined
Dec 31, 2001
Messages
42
hi. I have a combobox, SuppliersID.
the combo shows 3 columns.
The width of the first two is 0, so I can see the third column only.
I want to sort the combo according to the third column - the one I see once the Combobox is being openned.
Is that possible ?
 
Use a query as the recordsource of your combo. In the query QBE grid you can specify ordering on one or several fields.

Alex
 
I haven't thought about it..thanks
 
I came to realize that I have too many fields I want to sort. Making a query for each one of them will be a complicated work.
Can you think of a more effective solution?
 
I don t understand. You originally wanted to order a 3 columns recordset on one field. Now you talk about too many fields to sort?

You can sort on various fields if you want, just like in Excel. You do not need to make various queries for that, just specifiy the ordering you want for the fields you want in your query.Access will order first according to the leftmost field, then the second leftmost...

Ex:
1__1
1__2
1__3
2__1
2__2
2__3

If this misses the point, provide more details on what you are trying to do.

Alex

[This message has been edited by Alexandre (edited 02-05-2002).]
 
I meant to say that I have many Combo Boxes in my prog based on the same strategy: 3 columns when the width of the first two are 0 and thus only the third column is seen. When I sort those Combos, it is sorted according to the first columns and not the one seen.
Ex: SuppliersID, SuppliersLastName, SuppliersFirstName
My Combo shows only SuppliersFirstName but sorts according to SuppliersID
I want it to be sorted according to one of the other two columns instead.
 
Change the rowsource of the combo to a query as Alexandre suggested. If all the combo boxes show the same info, they can share the same query. You don't need a different query for each of them.
 
Yes you both are right.
I'll do it. Thanks
 

Users who are viewing this thread

Back
Top Bottom