473,503 Members | 8,131 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to add "All" to a combo-box

I have been going through user groups and forums for the past 3 hours
trying to figure out how to add "all" to my combo boxes.

I've got two unbound comboboxes. Once only has one field "FiscalYear"
and the other had two "DonationTypeID" and "DonationType". Both
comboboxes have Table/Query as the control RowSourceType and I setup
the RowSource through the query wizard interface.

Using the instructions I found at
http://www.mvps.org/access/forms/frm0043.htm, I went from

SELECT [TBL-zlist-FiscalYear].FiscalYear
FROM [TBL-zlist-FiscalYear]
ORDER BY [TBL-zlist-FiscalYear].FiscalYear;

to:

SELECT [TBL-zlist-FiscalYear].FiscalYear
FROM [TBL-zlist-FiscalYear]
UNION SELECT Null as AllChoice, "(All)" as Bogus From
[TBL-zlist-FiscalYear]
ORDER BY [TBL-zlist-FiscalYear].FiscalYear;

but I can't seem to make it work. I get the error "The number of
columns in the two selected tables or queries of a union query do not
match".

I'm sure this is because this combo only has one field, but I don't
know enough about Union queries or coding to fix it. Any help would
be EXTREMELY APPRECIATED!
Loreen
Nov 12 '05 #1
1 4632
rkc

"Loreen" <Lo************@yahoo.com> wrote in message
news:9c**************************@posting.google.c om...
I have been going through user groups and forums for the past 3 hours
trying to figure out how to add "all" to my combo boxes.

I've got two unbound comboboxes. Once only has one field "FiscalYear"
and the other had two "DonationTypeID" and "DonationType". Both
comboboxes have Table/Query as the control RowSourceType and I setup
the RowSource through the query wizard interface.

Using the instructions I found at
http://www.mvps.org/access/forms/frm0043.htm, I went from

SELECT [TBL-zlist-FiscalYear].FiscalYear
FROM [TBL-zlist-FiscalYear]
ORDER BY [TBL-zlist-FiscalYear].FiscalYear;

to:


Try this:

SELECT [TBL-zlist-FiscalYear].FiscalYear
FROM [TBL-zlist-FiscalYear]
UNION SELECT "(All)" as FiscalYear
From [TBL-zlist-FiscalYear]
ORDER BY [TBL-zlist-FiscalYear].FiscalYear;

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
12814
by: KENNY L. CHEN | last post by:
Dear experts, I have two tables in my Oracle 8i database: TEST (COL1,COl2,REC_NO) and TEST1 (COL1,COL2,REC_NO). Both tables are unique-indexed on (COL1,COL2,REC_NO). I think the following...
2
2473
by: Dale Ring | last post by:
Access 2000 I am trying to add "ALL" to a combo that is used to filter a query. When "ALL" is selected no records show instead of ALL records showing. I have setup a "dummy" table (tblDum)...
3
2125
by: Not Me | last post by:
Hi, Is there any criteria I can use in my where clause to say 'anything'? Maybe like the _ used in some languages? For my example, I want to use an inline-if, so if a checkbox is ticked I say...
2
5342
by: Murphy | last post by:
Our website contains subdirectories for each subsidiary company, each company has it's own look and feel to the pages in their subdirectory although they are all part of the main website. The...
4
4131
by: google | last post by:
Hi Hope someone can help me with this - have been staring at this problem all day, and with the cold I've got, just don't seem to be able to figure it out! I've got two tables, here with some...
2
5840
by: bhdvir | last post by:
Does anybody have any advice on selecting all records within a iif-statement? I have a form in which one has to state if all projects or just a selection of projects are to be used for a query....
3
3628
Zwoker
by: Zwoker | last post by:
Hi Everyone, I have a query that uses criteria from combo boxes in the form that runs it. When I had only discrete values in the combo boxes that matched the data that was being queried, the...
2
2340
by: getmeidea | last post by:
Hi all, String x = "\\"; This string will have the value \. Now for any string contains \, i need to replace with \\. But when i use x = x.replaceAll("\\", "\\\\"); I am getting runtime...
19
10727
by: Daniel Pitts | last post by:
I have std::vector<Base *bases; I'd like to do something like: std::for_each(bases.begin(), bases.end(), operator delete); Is it possible without writing an adapter? Is there a better way? Is...
0
7291
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
7357
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7012
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5598
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,...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3171
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1522
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
402
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.