title: Updating Record in a table VBA Access
body: <p>I am trying to update the record in an Access table using the below code and get an error that the data type is mismatch in criteria expression :</p>
  
  <pre><code>If Not (Me.frmdamagesub.Form.Recordset.EOF And Me.frmdamagesub.Form.Recordset.BOF) Then
    With Me.frmdamagesub.Form.Recordset
      Me.txtquantity = .Fields("Quantity")
      Me.txtquantity.Tag = .Fields("Quantity")
      Me.cmdedit.Caption = " Update"
      CurrentDb.Execute " UPDATE damaged_card " &amp; _
      " SET Quantity='" &amp; Me.txtquantity &amp; "'" &amp; _
      " WHERE Quantity=" &amp; Me.txtquantity.Tag
  
    End With
  End If
  </code></pre>