title: Code adds another record instead of updating it
body: <p>My program only has two buttons, namely to time in and time out.</p>
  
  <p>But every time I try to update the record of the time out it adds another record to the table.</p>
  
  <pre><code>Private Sub Form_Load()
  
  End Sub
  
  Private Sub Command536_Click()
  
  strSQL1 = "UPDATE BreakSked SET BreakSked.EndTime = '" &amp; Me.Text412.Value &amp; "',BreakSked.Duration = '" &amp; durationz &amp; "' " &amp; vbCrLf &amp; _
  "WHERE (([BreakSked].[AgentID]='" &amp; Me.List423.Value &amp; "'));"
  CurrentDb.Execute strSQL1
  CurrentDb.Close
  MsgBox "OK", vbOKOnly, "Added"
  
  End Sub
  
  Private Sub Command520_Click()
  
  strSql = "INSERT INTO BreakSked (ShiftDate,AgentID,StartTime,Status) VALUES ('" &amp; Me.Text373.Value &amp; "', '" &amp; Me.List423.Value &amp; "', '" &amp; Me.Text373.Value &amp; "','" &amp; Me.Page657.Caption &amp; "')"
  
  CurrentDb.Execute strSql
  CurrentDb.Close
  
  MsgBox "OK", vbOKOnly, "Added"
  
  
  End Sub
  </code></pre>