A Real Stumper

P

PeterM

I have a simple form with a combobox. The source of the combobox is a query
that is:

SELECT distinct firstname & " " & lastname AS Expr1
FROM contacts
UNION select distinct ap_with_whom
from calendar
ORDER BY 1;

When I run the query outside of the form, it returns what I expect. All
name entries from the contacts and calendar entries. However, when I run it
from within the form, I get different results. It only returns entries from
the calendar table. As a matter of fact, I use the same query in several
places and when run from the form, it only returns the entries from the
calendar table. This makes no sense to me. There are no filters on the
form.

I even tried to flip the query to:

select distinct ap_with_whom
from appointments
UNION SELECT distinct firstname & " " & lastname AS Expr1
FROM addresses
ORDER BY 1;

and I still get the same results.

Why am I getting different results from the form and from the query?
 
M

Maurice

That is strange and should not be happening.
How did you create the combo?

try this:
Create an empty form and drag the query from the dbwindow (or navpane in
2007) to the form. Do you still get the wrong results?

So don't create a combobox but just the form. Are the results as expected
the create a new combobox but not with a wizard. Choose the query as the
source and see what happens..
 
P

PeterM

Guys...

It just keeps getting stranger. I started over from scratch and rebuilt an
exact duplicate of the original form, and it's now giving me the results I
expect. The source of the original form was the calendar table.

I have no idea what I did to inadvertently correct the problem. I guess I
was just lucky. Thanks to you both for responding.

PeterM
 

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