I’m using the code below to run my queries and export to Excel. I’ve tried several file types but they all bomb out if the query comes back with more than 65,000 records.
Any ideas on how I can fix this?
Private Sub Command0_Click()
Dim qdftemp As QueryDef
Dim a As String
For Each qdftemp In CurrentDb.QueryDefs
a = qdftemp.Name
DoCmd.OutputTo acQuery, a, “Excel Workbook (*.xlsx)”, _
“C:DATA” & qdftemp.Name & “.xlsx”, False, “”
Debug.Print qdftemp.Name
Next
End Sub