It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Prophet (peace and blessings be upon him) said: "A man seeks something, and Allah keeps it away from him for the sake of what is better for him. Then he wrongfully accuses the people and says: 'Who has sated me (from asking)?'"
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 11961