title: "The data has been changed" error when editing underlying record in Access VBA
body: <p>I have a form in Access where I have 2 unbound multi-select listboxes, with some code to move items between them.</p>
  <p>Each of the fields in the table which are shown in the listboxes are boolean values - if the value is true then the name of that field shows up in <code>lstSelected</code>, and if false shows up in <code>lstUnselected</code>.</p>
  <p>The listboxes have a RowSourceType of Value List, and the value list is generated programatically by looking at the underlying record and constructing a string with the field names where the boolean values are true for <code>lstSelected</code> and False for <code>lstUnselected</code>.</p>
  <p>On the form I have two buttons, <code>cmdMoveToSelected</code> and <code>cmdMoveToUnselected</code>. When I click on <code>cmdMoveToSelected</code> it changes the boolean value of the underlying field for any selected items in the <code>lstUnselected</code> listbox from false to true by executing an SQL string, then rebuilds the value lists for both of the listboxes.</p>
  <p>I have all of this working just fine. If I do a <code>me.lstUnwanted.requery</code> and a <code>me.lstwanted.requery</code> then everything moves and shows up correctly, and the underlying fields are edited correctly, BUT when I click on anything else on the form I get the error:</p>
  <blockquote>
  <p>The data has been changed.</p>
  <p>Another  user edited this record and saved the changes before you attempted to save your changes.</p>
  <p>Re-edit the record.</p>
  </blockquote>
  <p>Now I've found a way around this (<code>jobDetailsID</code> is the primary key of the record being dealt with):</p>
  <pre><code>    Dim intCurID as Integer
  
      intCurID = Me.JobDetailsID
  
      Me.Form.Requery
  
      Me.Recordset.FindFirst &quot;JobDetailsID = &quot; &amp; curID
  </code></pre>
  <p>This requeries the form and then moves back to the current record, and this gets rid of the error, however it causes there to be a delay and the form to flicker while it opens back at the first record, changes back to the correct record and repopulates the list boxes.</p>
  <p>Is there a way to do away with this error, or get it to trigger programmatically so I can catch it by turning the warnings off via vba?</p>
  <p>Thanks in advance.</p>