I tied this code to a command button in a MSAccess form. The purpose is to insert an update to an existing record and add a date to the TIME OUT field. Whenever I run this code block it updates the record but also creates a duplicate entry in the same table with the same unique ID. So it looks like this on the table side view.
It looks like this on the form:
I'm trying to understand why this happening. Just for some extra info. Here is my table structure:
Private Sub CheckOutBtn_Click()
Dim rst As Recordset
Dim employeeInt As Integer
Dim strSQL As String
employeeInt = Int(Me!EmployeeID)
With CurrentDb.OpenRecordset("TimeTable")
.Edit
![EmployeeID] = employeeInt
![TImeOut] = Now()
.Update
End With
Me.Refresh
End Sub
Any help would be appreciated!