I have a cat that had the same kind of problem for over a year. We had a bunch of tests done, tried a punch of pills and nothing really helped. Finally the vet put the cat on "low residue" food (made by Iams). The cat hasn't had the problem since! You can only buy the food at the vets office...