title: Using VBA to write from one access table to another, not SQL
body: <p>In Access I am trying to write some code that will simply copy all the rows from one table into another.</p>
  
  <p>I am trying not to use SQl, this is in the hope that having VB do this will be a lot quicker, at the moment the query used to do this job takes an hour.</p>
  
  <p>It breaks at the first record, "record is deleted". Although the table where the record is exporting from has records in it.</p>
  
  <p>I'm wondering if anyone has any ideas about how to fix this?</p>
  
  <p>Or if I'm going about this the wrong way?</p>
  
  <pre><code>Public Sub ClientsImport()
  Dim rs As Recordset, rsIN As Recordset
  Dim db As Database
  
  Set db = CurrentDb()
  Set rs = db.OpenRecordset("tblDIFCClients_Import2", dbOpenDynaset)
  Set rsIN = db.OpenRecordset("tblDIFCClients_import_IN", dbOpenDynaset)
  
  Logit "Start:tblDIFCClients_import..."
  DoCmd.RunSQL ("delete * from tblDIFCClients_import_IN")
  Logit "... Cleared holding table..."
  CurrentDb.Execute ("qryMatch_TblClients1")
  Logit "... Grabbed from Server..."
  Logit "... Updating Live table..."
  DoCmd.RunSQL ("delete * from tblDIFCClients_import2")
  Logit "Append Clients"
  
  rsIN.MoveFirst
  With rs
      Do Until rsIN.EOF
      .AddNew
      ![fldDIFCClientsRAWID] = rsIN![fldDIFCClientsRAWID]
      ![fldClientID] = rsIN![fldClientID]
      ![fldClientname] = rsIN![fldClientname]
      ![fldStyleSheet] = rsIN![fldStyleSheet]
      ![fldcustomjs] = rsIN![fldcustomjs]
      ![fldBannerImage] = rsIN![fldBannerImage]
      ![fldLogoImage] = rsIN![fldLogoImage]
      ![fldVanityURL] = rsIN![fldVanityURL]
      ![fldDescription] = rsIN![fldDescription]
      ![fldBusinessNumber] = rsIN![fldBusinessNumber]
      ![fldBasePrimaryColour] = rsIN![fldBasePrimaryColour]
      ![fldDefaultForwardingEmail] = rsIN![fldDefaultForwardingEmail]
      ![fldHasPFPs] = rsIN![fldHasPFPs]
      ![fldHasMicrosite] = rsIN![fldHasMicrosite]
      ![fldHasEvents] = rsIN![fldHasEvents]
      ![fldDateTimeStamp] = rsIN![fldDateTimeStamp]
      ![fldModified] = rsIN![fldModified]
      ![fldDownloaded] = rsIN![fldDownloaded]
      ![fldIgnore] = rsIN![fldIgnore]
      .Update
      rsIN.MoveNext
  End With
  
  rs.Close
  Set rs = Nothing
  rsIN.Close
  Set rsIN = Nothing
  
  Logit "End: Clients Import"
  Logit ""
  Debug.Print "Done:Clients"
  </code></pre>