This study aims to analyze the influence of accounting students’ perceptions on the prevention of violations of the accountant code of ethics and to examine the role of professional ethics education as a moderating variable. A quantitative survey approach was employed. Primary data were collected through a structured questionnaire distributed to accounting students at Teuku Umar University through both online and direct distribution. A total of 126 student responses were included in the analysis. The study variables consisted of accounting students’ perceptions, prevention of accountant code-of-ethics violations, and professional ethics education. Data were analyzed using multiple linear regression with Moderated Regression Analysis (MRA) to examine the effect of students’ perceptions and the strengthening role of professional ethics education. The findings indicate that accounting students’ perceptions have a positive and significant effect on the prevention of accountant code-of-ethics violations. Descriptively, 82% of respondents supported preventive measures and rejected ethical violations, while 18% still showed some tolerance associated with ethical dilemmas and external pressure. Professional ethics education strengthened the relationship between students’ perceptions and prevention. These findings indicate that ethical perception formation in higher education should not stop at understanding ethical norms, but should be translated into the ability to recognize risks, evaluate dilemmas, and choose actions consistent with professional integrity. The study implies the need for applied ethics learning through case studies, decision-making simulations, and discussion of professional pressure situations.