Computers are steadily being incorporated in clinical practice. We conducted a nonrandomised, controlled, prospective trial of electronic messages designed to enhance adherence to clinical practice guidelines. We studied 126 physicians and nurse practitioners who used electronic medical records when caring for 349 patients with HIV infection in a primary care practice. We analysed the response times of clinicians to the situations that triggered alerts and reminders, the number of ambulatory visits, and hospitalisation. The median response times to 303 alerts in the intervention group and 388 alerts in the control group were 11 and 52 days (p < 0.0001), respectively. The median response time to 432 reminders in the intervention group was 114 days and that for 360 reminders in the control group was over 500 days (p < 0.0001). There was no effect on visits to the primary care practice. There was, however, a significant increase in the rate of visits outside the primary care practice (p = 0.02), which is explained by the increased frequency of visits to ophthalmologists. There were no differences in admission rates (p = 0.47), in admissions for pneumocystosis (p = 0.09), in visits to the emergency ward (p = 0.24), or in survival (p = 0.19). We conclude that the electronic medical record was effective in helping clinicians adhere to practice guidelines.