470,602 Members | 1,664 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,602 developers. It's quick & easy.

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 4450
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Dale Ring | last post: by
3 posts views Thread by Not Me | last post: by
2 posts views Thread by bhdvir | last post: by
19 posts views Thread by Daniel Pitts | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.