Private Sub DateControlName_BeforeUpdate (Cancel As Integer)
If DCount("*","TableName","DateFieldName=#" & Me.DateControlName & "#")>0 Then
Cancel=True
Me.DateControlName.Undo
MsgBox "You entered a duplicate date. Please try again.", vbInformation,"Duplicate Date!"
End If
End Sub