0

I created a drop down list in MS Access (Form) based on a Query (multiple tables), the problem is it takes about a minute to open the drop down.
If I open the Query it opens instantly.

I found out what is making the Drop down to respond so slowly. It's a criteria that I have in the Query:

In (SELECT [ObjectID] FROM [ObjectDetail] As Tmp GROUP BY [ObjectID] HAVING Count(*)>1) 

If I remove this Criteria from the Query, the drop down works perfectly and instantly.

So my question is this: Is there any way to make the drop down respond quicker, while still maintaining the criteria?
This is how my drop down Query looks like :

SELECT Version_Change.ObjectID, Version_Change.Key FROM Version_Change 
UNION 
SELECT "(All)" as ObjectID,"" as Key FROM Version Change;
Andre
  • 26,751
  • 7
  • 36
  • 80
adp
  • 311
  • 2
  • 7
  • 19

1 Answers1

0

By basing the second UNION part on the complex query, and then filtering out duplicates with UNION instead of UNION ALL, you add unnecessary complexity.

Try this:

Create a dummy table DummyOneRecord with one field (doesn't matter what) and add one record.

Then use (note the UNION ALL)

SELECT Version_Change.ObjectID, Version_Change.Key FROM Version_Change 
UNION ALL
SELECT "(All)" as ObjectID, "" as Key FROM DummyOneRecord;
Andre
  • 26,751
  • 7
  • 36
  • 80