ComboBox RowSource UnionQuery

G

gator

I have a Union Query named "Union Query". I want to add a combo box to a
form and set it's row source as....
SELECT DISTINCT field11 FROM Union Query

The Union Query is combining about 7 tables and takes a few seconds to
compile, when I just run the query by itself, but I've tested it and it
works.

BUt, I am getting errors when I try to click the combo box. Here is the
error...
Syntax error in FROM clause

So I changed the row source to
SELECT DISTINCT field11 FROM Union_Query

I then get error....
The record source 'SELECT DISTINCT field11 FROM UNION_QUERY;' specified on
this form or report does not exist.

THe Union Query is named "Union Query" and here is the SQL for it....
select [field3],[field6],[field7],[field8],[field11],[field12]
from [2007Q1]
UNION select [field3],[field6],[field7],[field8],[field11],[field12]
from [2007Q2]
UNION select [field3],[field6],[field7],[field8],[field11],[field12]
from [2007Q3]
UNION select [field3],[field6],[field7],[field8],[field11],[field12]
from [2007Q4]
UNION select [field3],[field6],[field7],[field8],[field11],[field12]
from [2008Q1]
UNION select [field3], [field6],[field7],[field8],[field11],[field12]
from [2008Q2]
UNION select [field3], [field6],[field7],[field8],[field11],[field12]
from [2008Q3]
UNION select [field3], [field6],[field7],[field8],[field11],[field12]
from [2008Q4]
UNION select [field3],[field6],[field7],[field8],[field11],[field12]
from [2009Q1]
UNION select [field3],[field6],[field7],[field8],[field11],[field12]
from [2009Q2];

What am I doing wrong?
 
K

KARL DEWEY

Try this --
SELECT DISTINCT field11 FROM [Union Query];

You got to enclose the name in brackets if you use a space in the table name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top