If a query (or selection based on that query) is in use anywhere in the program as part of a process or otherwise, the query cannot be deleted. If you attempt to delete a query that is in use, this message appears to inform you that the operation is not allowed.  Delete the query from wherever it is in use.

Currently, there is no standard method of determining where a query may be in use. Consider what the query was created for and check those locations first. 

Alternately, product development may be able to assist with specific instances:
Contact Support and reference this article. 

Note: If this is occurring when deleting a query after it's been merged into another query, please refer here for additional information.