sorting cbo with 'all' selection

J

Junior

using the code below as rowsource - is there a way to control the order of
selections with ORDERBY in this SQL?
I tried creating a sorted query for the cbo but still didn't change the
order in the cbo?

SELECT TlkpAppPosition.PosID, TlkpAppPosition.PosDesc FROM TlkpAppPosition
UNION Select "ALL" as AllChoice , "ALL Applications" as Bogus FROM
TlkpAppPosition;
 
A

Allen Browne

Place the ORDER BY clause at the end of your UNION query:

SELECT TlkpAppPosition.PosID, TlkpAppPosition.PosDesc
FROM TlkpAppPosition
UNION ALL
SELECT " ALL" as AllChoice , "ALL Applications" as Bogus
FROM TlkpAppPosition
ORDER BY PosDesc;
 
J

Junior

Thanks Allen
Allen Browne said:
Place the ORDER BY clause at the end of your UNION query:

SELECT TlkpAppPosition.PosID, TlkpAppPosition.PosDesc
FROM TlkpAppPosition
UNION ALL
SELECT " ALL" as AllChoice , "ALL Applications" as Bogus
FROM TlkpAppPosition
ORDER BY PosDesc;
 
P

PC Datasheet

Change this, SELECT " ALL" as AllChoice to this:
SELECT " ALL" as <All>
and sort ascending.
Special characters "<" sort before alpha characters.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com

If you can't get the help you need in the newsgroup, I can help you for a
very reasonable fee.
Over 1000 Access users have come to me for help.
Need a month calendar or 7 day calendar? Contact me.
 
A

Allen Browne

Steve, I presume you intended the angle brackets as part of the literal
(inside the quotes) rather than as part of the field name.

Of course, the leading space I suggested sorts to the top anyway.
 

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