By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,222 Members | 1,129 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,222 IT Pros & Developers. It's quick & easy.

How to get "<All>" selection in combo box?

P: n/a
SELECT TxType_ID, TxTypeName FROM tblTxType UNION SELECT Top 1 TxType_ID,
"<Payment Account>" FROM tblTxType
ORDER BY [TxTypeName];
The problem I'm having is that the Top 1 "TxType_ID" brings up a TxTypeName
in the combo box -- rather than "<Payment Account>".

It doesn't seem to matter what the first argument is after UNION SELECT, as
long as there is no collision of ID numbers, but what is the best practice
when putting an ad hoc selection in a combo box?

thanks in advance!
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"deko" <dj****@hotmail.com> wrote in
news:3J******************@newssvr27.news.prodigy.c om:
SELECT TxType_ID, TxTypeName FROM tblTxType UNION SELECT Top 1
TxType_ID, "<Payment Account>" FROM tblTxType
ORDER BY [TxTypeName];
The problem I'm having is that the Top 1 "TxType_ID" brings up
a TxTypeName in the combo box -- rather than "<Payment
Account>".
try SELECT TxType_ID, TxTypeName FROM tblTxType UNION SELECT "",
"<Payment Account>" FROM tblTxType
ORDER BY [TxTypeName];

It doesn't seem to matter what the first argument is after
UNION SELECT, as long as there is no collision of ID numbers,
but what is the best practice when putting an ad hoc selection
in a combo box?
Make the entire row from after the union Manually entered. You
don't have to worry about TOP 1, or collision of ID numbers.

Bob Q

thanks in advance!


Nov 12 '05 #2

P: n/a
> SELECT TxType_ID, TxTypeName FROM tblTxType UNION SELECT Top 1 TxType_ID,
"<Payment Account>" FROM tblTxType
ORDER BY [TxTypeName];
The problem I'm having is that the Top 1 "TxType_ID" brings up a TxTypeName
in the combo box -- rather than "<Payment Account>".

It doesn't seem to matter what the first argument is after UNION SELECT, as
long as there is no collision of ID numbers, but what is the best practice
when putting an ad hoc selection in a combo box?


Try:

SELECT TxType_ID, TxTypeName FROM tblTxType UNION SELECT 0,
" <Payment Account>" FROM tblTxType
ORDER BY [TxTypeName];

You simply need to code to deal with the "0" selection (you can replace the "0"
with any value that you know won't exist in the ID field in the table).

--
Bruce M. Thompson
bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access)
NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<
Nov 12 '05 #3

P: n/a
that's the ticket!

thanks for the help!

"Bruce M. Thompson" <bthmpson@big_NOSPAM_foot.com> wrote in message
news:vo************@corp.supernews.com...
SELECT TxType_ID, TxTypeName FROM tblTxType UNION SELECT Top 1 TxType_ID,
"<Payment Account>" FROM tblTxType
ORDER BY [TxTypeName];
The problem I'm having is that the Top 1 "TxType_ID" brings up a TxTypeName in the combo box -- rather than "<Payment Account>".

It doesn't seem to matter what the first argument is after UNION SELECT, as long as there is no collision of ID numbers, but what is the best practice when putting an ad hoc selection in a combo box?
Try:

SELECT TxType_ID, TxTypeName FROM tblTxType UNION SELECT 0,
" <Payment Account>" FROM tblTxType
ORDER BY [TxTypeName];

You simply need to code to deal with the "0" selection (you can replace

the "0" with any value that you know won't exist in the ID field in the table).

--
Bruce M. Thompson
bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access) NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.