
New records not allowed by query...
Hi,
The resulting recordset will not be updatable, given that one row in the
query-view might stand for various records in the underlying tables. If you
want to see the records that have duplicate values in some field you can use
a subquery in which the number of hits for a specific value are counted.
Like:
SELECT DISTINCTROW <fields from editquery>
FROM <editquery>
WHERE (((<the field that might contain duplicate values>) In (SELECT [the
same field] FROM [editquery] As Tmp GROUP BY [the same field) HAVING
Count(*)>1 )))
Don't take the number of brackets in the example above too literally.
Greetings,
TK
Quote:
>Hi, I was wondering if anyone can help me with this problem:
>I have the follwing query for duplicates
>SELECT DISTINCTROW [Edit Query].Company AS [Company Field],
>Count([Edit Query].Company) AS NumberOfDups, [Edit Query].Company,
>[Edit Query].ID
>FROM [Edit Query]
>GROUP BY [Edit Query].Company, [Edit Query].Company, [Edit Query].ID;
>The query is linked to a form, which, when there are no records
>generated by the query, is totally greyed out and does not allow me to
>enter a new record. I need to be able to enter a new record when none
>if found. How do I overcome this?
>I appreciate your help,
>George B.