Hi petite39,
For data validations, it's better to use the BeforeUpdate event so that you can "stop" the user from entering the wrong information.
For your setup, you could also use the DCount() function to check for duplicate records. For example:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If DCount("*", "tblTimeClockData", "EmployeeID=" & Me.txtEmployeeID & " And DateIn = #" & Me.txtDateIn & "#") > 0 Then
Cancel = True
MsgBox "Duplicate record! Please try again."
End If
End Sub
Notice that I used "txtEmployeeID" because I am not sure what txtEmployeeName contains. The above code assumes a numeric data for the employee ID fiedl.
Just my 2 cents...