title: VBA only exports partial recordset
body: <p>The following code is linked to my access database and exports one column from the table to a txt file, however, it randomly stops on a specific record and won't export the rest of the file:</p>
  <pre><code>Sub ExportTxtFiles()
  
      Dim rst As DAO.Recordset
      
      Open &quot;\\...Export Files\ZM.txt&quot; For Output As #1
          
      Set rst = CurrentDb.OpenRecordset(&quot;tbl_temp&quot;, dbOpenSnapshot)
      
      If rst.RecordCount &gt; 0 Then
          rst.MoveFirst
          Do Until rst.EOF
              Print #1, rst!ID
          rst.MoveNext
          Loop
      End If
      
      rst.Close
      
      Set rst = Nothing
      
  End Sub
  </code></pre>
  <p>Table has 347 lines and stops halfway through the number in line 304.</p>