copied and pasted as below but still #error.
=IIf(CLng([txt_coursedate]) > CLng(DMax("certexpires","qry_personcert")), DateAdd("m",36,[txt_coursedate]), IIf(CLng([txt_coursedate]) Between CLng(DMax("certexpires","qry_personcert")) And CLng(DateAdd("m",-3,DMax("certexpires","qry_personcert")))...