title: Delete multiple records in subform
body: <p>In Access 2007, I have a main form and a subform datasheet. I have a delete record button for the subform on the main form. I can obtain SelTop and SelHeight (via global variables) when the user selects several records in the subform for deletion.</p>
  
  <p>In the OnClick function on the delete button I have the code</p>
  
  <pre><code>DoCmd.SetWarnings False
  DoCmd.RunCommand acCmdDeleteRecord
  DoCmd.SetWarnings True
  </code></pre>
  
  <p>With the code like this the DoCmd will only delete one record. If I remove the warnings, DoCmd puts up its own warning but then deletes all the selected records.</p>
  
  <p>Is this a feature in Access or some error I've committed? (The latter wouldn't surprise me, I'm going square-eyed through coding all day.)</p>
  
  <p>I don't want to use the default DoCmd message, as I want to provide other information to the user at the same time.</p>
  
  <p>If this behaviour is a quirk in Access, how do I delete multiple records in the subform? I've searched everywhere but can find no useful help.</p>