Beginning of summarized translated fatwa from the Jordanian Fatwa Authority
Question: There is a hadith that says the prayer of an alcohol-drinker will not be accepted for forty nights. Should such a person wait for forty days before coming back to the prayer?
Answer: Our advice to this alcohol-drinker is to fear God and to not let the faith he has to die out from his heart. His heart which desires prayer is a believer’s heart which feels the danger [of abandoning the prayer]. As for the hadith on the prayer of an alcohol-drinker not being accepted for forty days, it is narrated by ʿAmr b. al-ʿĀṣ [ra] that the Prophet PBUH said: “A man of my umma does not drink and have his prayer accepted for forty days.” (Narrated by al-Nasāʾī).
In this hadith there is no prohibition on the alcohol-drinker when it comes to praying. It is actually obligatory on him and required of him. The hadith tells us that he gets no reward from the prayer as a punishment for engaging in such a sinful thing. He is still required to pray and commits a tremendous sin by abandoning the prayer.
End of summarized translated fatwa
Source (Arabic PDF)