L
Leif
I'm trying to create a query to supply a recordset for a
form. The fields are all from a single table, however I
only want records where one of the fields (an indexed,
duplicates allowed field) match a unique list of values
from a query. The query is a UNION of two other queries.
Both of the underlining queries have their Unique Values
property set to Yes. There is no Unique Value property
for the Union query.
If I use a join between a table and the query the
resulting query is not updatable. An example is the
following:
SELECT Table1.Field1, Table1.Field2, Table1.Field3
FROM Table1 INNER JOIN Query1 ON Table1.Field1 =
Query1.Field1;
This produces a query that runs quickly, but is not
updatable because it is joined on a field (in table 1)
that is not unique and a query field that is unique (but I
don't seem to have a way to let Access know that).
The other way is to create a subquery in the WHERE clause
to select only the desired records. This recordset set is
updatable, but runs VERY slowly. It appears that the
subquery is run for EVERY SINGLE row of the main table.
The query looks like this:
SELECT Field1, Field2, Fields3
FROM Table1
WHERE (Table1.Field1 In (SELECT Field1 FROM Query1));
Any suggestions? Thanks.
form. The fields are all from a single table, however I
only want records where one of the fields (an indexed,
duplicates allowed field) match a unique list of values
from a query. The query is a UNION of two other queries.
Both of the underlining queries have their Unique Values
property set to Yes. There is no Unique Value property
for the Union query.
If I use a join between a table and the query the
resulting query is not updatable. An example is the
following:
SELECT Table1.Field1, Table1.Field2, Table1.Field3
FROM Table1 INNER JOIN Query1 ON Table1.Field1 =
Query1.Field1;
This produces a query that runs quickly, but is not
updatable because it is joined on a field (in table 1)
that is not unique and a query field that is unique (but I
don't seem to have a way to let Access know that).
The other way is to create a subquery in the WHERE clause
to select only the desired records. This recordset set is
updatable, but runs VERY slowly. It appears that the
subquery is run for EVERY SINGLE row of the main table.
The query looks like this:
SELECT Field1, Field2, Fields3
FROM Table1
WHERE (Table1.Field1 In (SELECT Field1 FROM Query1));
Any suggestions? Thanks.