Connecting Tech Pros Worldwide Help | Site Map

How to add "All" to a combo-box

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 03:43 PM
Loreen
Guest
 
Posts: n/a
Default 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

  #2  
Old November 12th, 2005, 03:43 PM
rkc
Guest
 
Posts: n/a
Default 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;



 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.