Wa`alaykum As-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
Dear brother in Islam, thanks a lot for your question, which reflects your care to have a clear view of the teachings of Islam. Allah commands Muslims to refer to knowledgeable people to become well acquainted with the teachings of Islam in all aspects of life.
According to the Qur'an and Sunnah, it is haram (forbidden) to drink alcohol or alcoholic beverages. Even a small amount of alcohol is haram and it must be avoided. As for medicine containing alcohol, the basic ruling in normal circumstances is that it should be avoided unless there is a necessity and there is no alternative and it is prescribed by a trustworthy Muslim doctor.
In his response to your question, Sheikh Muhammad Al-Mukhtar Ash-Shinqiti, director of the Islamic Center of South Plains, Lubbock, Texas, states the following:
The basic rule in normal circumstances is to avoid the thing that has alcohol as ingredient. Therefore, if you have an alternative medication that is alcohol-free, then it is forbidden to use the alcohol-based one. This is based on the Prophet’s saying: "What intoxicates in big quantity, a small amount of its consumption is also forbidden" (At-Timidhi).
However, if no alternative is available, the fiqh councils have concluded that based on the rule of istihlak (a case when the forbidden substance is insignificant compared to the lawful one), the alcohol-based medication is permissible. This is based on the fact that seeking medical treatment is necessary. It is reported that Prophet Muhammad (peace be upon him) allowed `Abdur-Rahman ibn `Awf to wear silk, which is forbidden for men, because he was suffering from scabies (a skin disease).