title: VBA - Access - updating table with new data from user form
body: <p>I have created a form in Access (provides information on reviewers), of which one part is a comment section (I have two comment sections, one shows the comments against the person and the other is to add new comments).</p>
  
  <p>I have a table that holds the comments against the ID of each person which the form pulls in when you search for a reviewer through a combo box.</p>
  
  <p>I have done the code for adding the comments (ID of the person and the new comments), but it just creates a new field in the table (or does not add it if I stop duplications).</p>
  
  <p>What I want it to do is look to see if the ID is in the table, and if it is, replace the old comment with the new comment, otherwise, add the new ID/Comment to the table. </p>
  
  <p>My code so far is:</p>
  
  <pre><code>Dim strSQL As String
  
     strSQL = "INSERT INTO panelComment (ID, Comments) VALUES (" &amp; Me!Text14 &amp; ", '" &amp; Me!Text29 &amp; "');"
     DoCmd.RunSQL strSQL
  
  End Sub
  </code></pre>
  
  <p>Any suggestions? Thank you.</p>