Occupational asthma and allergies are potentially preventable diseases affecting 5-15% of the working population. However, the use of preventive measures is often insufficient. The aim of this study was to estimate the average treatment effect of an educational intervention designed to improve the knowledge of preventive measures against asthma and allergies in farm apprentices from Bavaria (Southern Germany). Farm apprentices at Bavarian farm schools were asked to complete a questionnaire evaluating their knowledge about preventive measures against occupational asthma and allergies (use of personal protective equipment, personal and workplace hygiene measures). Eligible apprentices were randomized by school site to either a control or an intervention group. The intervention consisted of a short educational video about use of preventive measures. Six months after the intervention, subjects were asked to complete a post-intervention questionnaire. Of the 116 apprentices (70 intervention group, 46 control group) who answered the baseline questionnaire, only 47 subjects (41%; 17 intervention group, 30 control group) also completed the follow-up questionnaire. We, therefore, estimated the causal effect of the intervention using targeted maximum likelihood estimation. Models were controlled for potential confounders. Based on the targeted maximum likelihood estimation, the intervention would have increased the proportion of correct answers on all six preventive measures by 18.4% (95% confidence interval 7.3-29.6%) had all participants received the intervention vs. had they all been in the control group. These findings indicate the improvement of knowledge by the educational intervention.