Thank you, Ben, for the quick reply. In fact, the size of the db shrunk to 80%, so there had to be a lot of junk in it. Unfortunately, it solved the problem only partially: The first time the sub is called, the error ocurs in any case (A or B), then, by changing the filter criteria and calling...