Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing an item to the bottom of a drop-down list

Status
Not open for further replies.

barrylowe

Programmer
Nov 6, 2001
188
0
0
GB
I have a combo box which is used to allow the to select a response source from a preset list.

The sources are in a table called lkup_RepsonseSources

The SQL behind the combo box rowsource is as follows:

SELECT lkup_ResponseSources.ResponseSourceID, [SourceRef] & " : " & [SourceDescription] AS SourceName
FROM lkup_ResponseSources
ORDER BY [SourceRef] & " : " & [SourceDescription];

What I want to do is add an "Other" option into the list, but always have it appear at the bottom of the list.

Any ideas?

 
You may try this SQL code:
SELECT ResponseSourceID, SourceName
FROM (SELECT ResponseSourceID, [SourceRef] & " : " & [SourceDescription] AS SourceName
FROM lkup_ResponseSources ORDER BY 2) AS A
UNION ALL SELECT 0, 'Other' FROM MSysObjects WHERE ID=2

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hey, thanks for that.

That worked OK for inserting Other into the list but the rest of the list needs to be in alphabetic order with Other coming at the end.

Any thoughts?
 
What is YOUR actual code ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I have done, but as I said in my second posting it does not order the rest of the list correctly.

It does indeed insert Other at the end of the list but the preceeding items are not in alphabetic order.
 
The rowsource for the combo box is:

SELECT ResponseSourceID, SourceName FROM (SELECT ResponseSourceID, [SourceRef] & " : " & [SourceDescription] AS SourceName FROM lkup_ResponseSources ORDER BY 2) AS A UNION ALL SELECT 0, 'Other' FROM MSysObjects WHERE ID=2;
 
No, they appear to be sorted by the order they were entered into the database.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top