473,396 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
3 3630
"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
> 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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
3
by: H. S. | last post by:
Hi, I am trying to compile these set of C++ files and trying out class inheritence and function pointers. Can anybody shed some light why my compiler is not compiling them and where I am going...
2
by: bissatch | last post by:
Hi, I am trying to use JavaScript to write a table column on a web page. The code is as follows: <html> <head> <script> function displaycount() {
0
by: Doug | last post by:
I got this as soon as I installed Vis Studio 2003, which either requires different permissions to inetpub\wwwroot or changed them during installation. I couldn't open an existing solution or...
2
by: andrew007 | last post by:
I do xml / xslt transformation using asp.net but I found any value (w/xml format) in xml node html-encoded to &lt and &gt format if it's > or < tag. Since I have sub xml data in a parent xml node...
8
by: active | last post by:
I use quickwatch on (astrThisOne <> "") and it reports: False as it should because astrThisOne reports: "" Yet If (astrThisOne <> "") Then executes the Then clause
8
by: someone | last post by:
I'm making an program that encodes text, and then writes it into another text file. The problem is that I can't seem to get the "file exists" checking right. If I use the command (coder is the...
3
by: hSiplu | last post by:
hi all, I am creating a web project with php/mysql. one of qeury result is too high. it returs several thousand rows. But I can't show them in one page. So I wanna create more than one pages...
11
by: Holger | last post by:
Hi I have not been able to figure out how to do compound statement from C - "<test>?<true-val>:<false-val>" But something similar must exist...?! I would like to do the equivalent if python...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.