Easy, and always a good thing to validate. I learned over the years that you can't count on regional settings, so always validate your date formatting.
Private Sub dob_BeforeUpdate(Cancel As Integer)
On Error Resume Next
If DCount("*", "maintable", "[dob]=#" & Me.dob & "#") > 0 Then
MsgBox...