Display Order in ComboBox

R

ryguy7272

I checked several other posts and didn’t find my answer, so I’m not sure if
this can be done… I have a list of items in a Table. The list is as
follows: T, T1, T2, T3, etc… Finally, at the bottom of the list in my Table
I have Not Applicable. When I view the items in the ComboBox, the Not
Applicable bubbles up to the top, but I really wanted to display it in the
same order as the items in the Table, which is not necessarily alpha-order.
Is there any way to display items in a ComboBox exactly as they are in the
Table?

This is the RowSource:
SELECT LookupTable.T_Data FROM LookupTable GROUP BY LookupTable.T_Data;

Also experimented with this:
SELECT DISTINCT LookupTable.T_Data FROM LookupTable;

Tried this too:
SELECT LookupTable.T_Data FROM LookupTable;

This last attempt is pretty close, but it lists several blanks at the bottom
of the list (there are blanks because I have several Fields in the same
Table, which I use for looking up values for several ComboBoxes).

Any help would be greatly appreciated.


Regards,
Ryan---
 
J

Jeff Boyce

Ryan

If you are trying to have Access sort the values in the combobox any way
other than alphanumeric (or, if numbers, numeric), YOU have to tell Access
what to use. That means YOU get to create a new field that holds sort-order
information, and YOU get to put the values in.

You can eliminate the blanks (are those nulls, zero-length strings, or
spaces?) with a WHERE clause in your query.

Good luck

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

Maarkr

You could add a field to the lookup table, like T_Order, then number that
field in the order you want ( T1 = 1,T2=2,,,NA = 12) and then 'order by' on
that field in your combo query.
 
R

ryguy7272

Thanks for the tip Jeff!! I looked into it a bit more and found that this
works:
SELECT LookupTable.T_Data FROM LookupTable WHERE
(((LookupTable.T_Data)<>""));

Thanks again!
Ryan--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top