Question : How do I loop thru a MS Access recordset via VB and output an excel spreadsheet after each 40,000th record

I current have a Visual Basic Module within MS Access that I output the results of an MS Acceess table to an MS Excel spreadsheet.  My problem is my output is now over 65,000 records so I want  to output a spreadsheet after each 40,000 record.  Lastly, I am also having an issue in that my leading zeros are being truncated when I output the results from MS Access to MS Excel.

Thank you in advance.

Answer : How do I loop thru a MS Access recordset via VB and output an excel spreadsheet after each 40,000th record

use a variable in the loop. if it is greater than 40000 then open a new spreadsheet. or you can also achieve this by checking the current active cell position in the excel sheet.
Random Solutions  
 
programming4us programming4us