title: SQL UPDATE Statement in excel VBA not working ( mismatch error )
body: <p>I have error msg " data type mismatch in criteria expression. " when I try to use the code below    </p>
  
  <pre><code>Call Connect_to_db
  strSQL = "UPDATE StockTable " &amp; _
           "SET [Selected] = '" &amp; Sheets("InfoStockDes").Range("e" &amp; x) &amp; "' " &amp; _
           "WHERE [OwnerName] = '" &amp; Sheets("InfoStockDes").Range("a" &amp; x) &amp; "' " &amp; _
           "AND [OwnerShipMethod] = '" &amp; Sheets("InfoStockDes").Range("b" &amp; x) &amp; "' " &amp; _
           "AND [StockName] = '" &amp; Sheets("InfoStockDes").Range("c" &amp; x) &amp; "' " &amp; _
           "AND [Quantity] = '" &amp; Sheets("InfoStockDes").Range("d" &amp; x) &amp; "' "
           Debug.Print strSQL
  cn.Execute strSQL
  Call Close_db
  </code></pre>