title: How to use Access' OpenRecordset to get a record using its numeric key field?
body: <p>I have a problem in Access 2010 VBA trying to read a record from table to write it into TextBoxes.</p>
  
  <p>My table is "Products" and its ProductID field is numeric. I used this method before, but it just works for <strong>text fields</strong>, not for <strong>numeric</strong> fields (ProductID is autonumber).</p>
  
  <pre><code>Private Sub GetProduct(ID As TextBox, Name As TextBox, Price As TextBox)
      If ID &lt;&gt; "" Then
          Set db = CurrentDb
          Set rs = db.OpenRecordset("Productos", dbOpenDynaset)
  
          'PROBLEM IS HERE
          rs.FindFirst "ProductID=" &amp; "'" &amp; ID &amp; "'"
  
          If rs.NoMatch Then
              MsgBox "The producto doesn't exist."
              Price = ""
              Name = ""
          Else
              Name = rs!ProductName
              Price = rs!Price
          End If
  
          rs.Close
          Set rs = Nothing
          Set db = Nothing
      End If
  End Sub
  </code></pre>
  
  <p>Please, help me. This is for a Final Proyect and I don't know other, but this method. Please help me.</p>