#  Other Applications & Softwares  > Access Tables & Databases >  >  Export More than 65,000 Records

## ncurran217

I have been searching and trying some peoples different codes out there, but never seems to work when they say copy this code into a module and run it and should work.  I have a table that has over 6 million records in it, and I then usually filter out a certain state and want to export it.  With doing that I cannot leave "Export data with formatting and layout" unchecked, as it will then export every record.  I then thought about just doing a querying for that state, but I have certain filters and criteria which will still have more than 65,000 records.  

So can someone give me a walk through on how to have a code run and export the filtered data into multiple worksheets in an excel file?

Thanks in advance!

----------


## alansidman

If you run a query and filter it and you and leave the Export Data with formatting and layout unchecked you should be able to export up to 1 Million records to an Excel 2007 file.

http://support.microsoft.com/kb/924681

Here is another solution but probably not as acceptable to you.

http://support.microsoft.com/kb/120596

Alan

----------


## ncurran217

Ok, so for the first support link, I tried that, but it exported every single record, not the filtered records that I only wanted.  

Second support link.  How do I use that?  I have not created something like this so if you have a step by step on creating something like this to use that would be create.

----------


## alansidman

I am a little bit confused by your response to the first link.  If you created a query in the QBE and then clicked on the ribbon  tab External and export to Excel.  I am not sure how it would export more records than were found in the query.

----------


## ncurran217

I wasnt running a query, just filtering out the data on the table.

----------


## ncurran217

I know that if I ran a query, I can do it that way.  But how do I use this code then:

http://www.btabdevelopment.com/ts/de...aspx?PageId=48

The guy who created this said to do this:

"Yeah, try using my Export code. It worked for me with a set of 250,000 records going into Excel 2007 which can handle it.
Put the code from here into a standard module, name the module basExport and don't modify the function in any way - at least not at first. 
Make sure you have a DAO reference set in Access."

----------

