title: Update Data table with Multiple Criteria
body: <p>I am trying to update a ms-access table (Table2) with the following columns (Name, Card Date, Clock In Time, Clock Out Time)</p>
  
  <p>I need my sequel command to update the Clock Out Time when the Name, Card Date, Clock In Time (is max) and Clock out time (is null).</p>
  
  <pre><code>    Dim myconnection As OleDbConnection = New OleDbConnection
      Dim Update As String = "UPDATE Table2 SET [Clock Out Time]=" &amp; TimeLbl.Text &amp; " WHERE [Name]=" &amp; EmployeeLbl.Text &amp; ", AND [Card Date]= (select MAX(Card Date), AND [Clock In Time]= (select MAX(Clock In Time)), AND [Clock Out Time]=?"
      Dim dbsource As String = ("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=S:\Docs\PRODUCTION\Shop Manager\Shop_Manager\Shop_Manager\Database2.accdb;")
      Dim conn = New OleDbConnection(dbsource)
      Dim cmd As New OleDbCommand(Update, conn)
  
      Try
          conn.Open()
          cmd.ExecuteNonQuery()
          conn.Close()
      Catch ex As OleDbException
          MessageBox.Show("Error Clock Out Data from Table2")
      End Try
  </code></pre>