Have you tried to include the NOT into the subsearch, so if there are values it will be included, and if there is no results the subsearch will no return anything at all, and the query will execute. Modify your eval this way
eval search=" NOT ((ID1=".KEY." OR ID2=".KEY.") AND ID3=".VALUE.")"
Try it and let me know if it works.
... View more