PURPOSE Overdosing of the oral antidiabetic metformin in impaired renal function is an important contributory cause to life-threatening lactic acidosis. The presented project aimed to quantify and prevent this avoidable medication error in clinical practice. METHODS We developed and implemented an algorithm into a hospital's clinical information system that prospectively identifies metformin prescriptions if the estimated glomerular filtration rate is below 60 mL/min. Resulting real-time electronic alerts are sent to clinical pharmacologists and pharmacists, who validate cases in electronic medical records and contact prescribing physicians with recommendations if necessary. RESULTS The screening algorithm has been used in routine clinical practice for 3 years and generated 2145 automated alerts (about 2 per day). Validated expert recommendations regarding metformin therapy, i.e., dose reduction or stop, were issued for 381 patients (about 3 per week). Follow-up was available for 257 cases, and prescribers' compliance with recommendations was 79%. Furthermore, during 3 years, we identified eight local cases of lactic acidosis associated with metformin therapy in renal impairment that could not be prevented, e.g., because metformin overdosing had occurred before hospitalization. CONCLUSIONS Automated sensitive screening followed by specific expert evaluation and personal recommendations can prevent metformin overdosing in renal impairment with high efficiency and efficacy. Repeated cases of metformin-associated lactic acidosis in renal impairment underline the clinical relevance of this medication error. Our locally developed and customized alert system is a successful proof of concept for a proactive clinical drug safety program that is now expanded to other clinically and economically relevant medication errors.