title: How to copy data from a form+sub-form to table in ms access?
body: <p>I have created a form that has a subform attached. I have a button that runs a query to delete the record but first I want to copy the data from including all subform information if available to a table. I have used the following code but nothing happens. please! what am I have missing? </p>
  
  <pre><code>Private Sub Command63_Click() 
  Dim db As Database, delfile As Recordset, Criteria As String 
  Set db = CurrentDb 
  Set delfile = db.OpenRecordset("DelFile", DB_OPEN_DYNASET) 
  
  'add data to deleted taxpayer file table 
  With delfile 
      .AddNew 
      !DeletedBy = (Forms!MainMenu!username) 
      !Branch = Me.Branch 
      !TaxType = Me.TaxType 
      !Volume = Me.Volume 
      !Keyedby = Me.Keyedby 
      !DateKeyed = Me.DateKeyed 
      !CreatedAt = Me.CreatedAt 
      !Comment = Me.Comment 
  End With 
  delfile.Close 
  db.Close 
  End Sub
  </code></pre>