Connecting Tech Pros Worldwide Help | Site Map

How to add "All" to a combo-box

Loreen
Guest
 
Posts: n/a
#1: Nov 12 '05
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
rkc
Guest
 
Posts: n/a
#2: Nov 12 '05

re: How to add "All" to a combo-box



"Loreen" <Loreen_thurman@yahoo.com> wrote in message
news:9cdffcfc.0311201707.75fc6b89@posting.google.c om...[color=blue]
> 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:[/color]

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;



Closed Thread