How to arrange values in combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a combo box where it lists a single field recordset. However, this
recordset has a value all. Is there any way to display ALL first and then
display rest of the records in a ascending manner? In other words ALL should
be at the top and should not be affected by the ordering of other records.
Thanks for any help in advance.
 
try the following SQL statement in your combo box's RowSource, as

SELECT MyTable.MyField FROM MyTable ORDER BY IIf([MyField]="ALL",0,1),
MyTable.MyField;

substitute the correct table and field name, of course, and put the
statement on one line in the RowSource.

hth
 
Jack said:
I have a combo box where it lists a single field recordset. However, this
recordset has a value all. Is there any way to display ALL first and then
display rest of the records in a ascending manner? In other words ALL should
be at the top and should not be affected by the ordering of other records.


If the recordset comes from a table, just change the ALL
record to put a space in front of it. A space will sort
before any letters or numbers in the other revords.
 
Thanks for your help Tina. I am going to try your code with my parameters.
Regards

tina said:
try the following SQL statement in your combo box's RowSource, as

SELECT MyTable.MyField FROM MyTable ORDER BY IIf([MyField]="ALL",0,1),
MyTable.MyField;

substitute the correct table and field name, of course, and put the
statement on one line in the RowSource.

hth


Jack said:
Hi,
I have a combo box where it lists a single field recordset. However, this
recordset has a value all. Is there any way to display ALL first and then
display rest of the records in a ascending manner? In other words ALL should
be at the top and should not be affected by the ordering of other records.
Thanks for any help in advance.
 
Thanks for your help Marshall. I appreciate it.

Marshall Barton said:
If the recordset comes from a table, just change the ALL
record to put a space in front of it. A space will sort
before any letters or numbers in the other revords.
 
Or ----------

Use All like this: <All>

The "<" sorts before any letters or numbers in the other records.
 
Back
Top