It is narrated concerning Sayyiduna Abu Abd al-Rahman al-Khatmi al-Ansari (may Allah be pleased with him): his son Abd al-Rahman said: I heard my father say: I heard the Messenger of Allah (peace and blessings be upon him) say: "Whoever plays at gambling and then stands up to pray, his likeness is that of one who performs ablution with pus and the blood of swine." So would it be said that Allah will accept his prayer?
Hadith Referenceالمعجم الكبير للطبراني / مسند من يعرف بالكنى / 18952