title: MS Access DAO Connection Discard Changes On Exit
body: <p>So I have this Access form where I use this VBA code with a DAO connection to a MySQL database. Everything works great but if the user closes the form without clicking save button the new record is saved anyway.</p>
  
  <p>So what I'm looking for is if there's any way the on the on close event I can stop the new record being saved to the database?</p>
  
  <p>The code I have,</p>
  
  <pre class="lang-vb prettyprint-override"><code>Private Sub Form_Load()
      'Set Form Recordset
      Dim db As DAO.Database
      Dim rs As DAO.Recordset
      Dim SQL As String
  
      Set db = OpenDatabase("", False, False, Globales.ConnString)
      SQL = "SELECT tbl6Suplidores.ID, tbl6Suplidores.NombreSuplidor, tbl6Suplidores.NumeroComerciante, tbl6Suplidores.DescripcionBienes, tbl6Suplidores.NombreContacto, tbl6Suplidores.NumeroTelefono, tbl6Suplidores.Email " _
          &amp; "FROM tbl6Suplidores;"
  
      Set rs = db.OpenRecordset(SQL, dbOpenDynaset, dbAppendOnly)
      Set Me.Form.Recordset = rs
  End Sub
  </code></pre>
  
  <p>I'm thinking that since I used the <code>dbAppendOnly</code> it won't let me just delete current record on close event?</p>
  
  <p>Any ideas welcome! 
  Thanks!</p>