Whenever I run the following criteria on my ODBC SQL connection, Access closes with the error "Access has stopped working". If I run the same query on a local database, it works fine. If I run the full query without that criteria on my ODBC connection, it works fine as well. Only with this code segment does it crash, and only when connected to the ODBC server.
Any ideas?
Any ideas?
Code:
WHERE [Time Table].[Order Number] In
(SELECT DISTINCT [Order Number] FROM [Time Table] AS Q1 WHERE exists
(SELECT DISTINCT [Part Number] FROM [Time Table] AS Q2 WHERE [Part Number] NOT IN
(SELECT DISTINCT [Part number]
FROM [Time Table] AS Q3
WHERE [Location]='Shipped' AND Q2.[Order Number]=Q3.[Order Number]) AND Q2.[Order Number]= Q1.[Order Number] ))