The dB in Post #14 is corrupt. There were form code modules but the forms were deleted.
I managed to copy the code for form "USED_Form_Main" from the previous dB (Post #12) and paste it into the form "USED_Form_Main" in the dB in Post #14.
It appears that your export code is working correctly.
I think I mislead you. This line uses a parameter for A2010- 2016
Code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, strcExportQuery, strFile
For A2007, use this line
Code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, strcExportQuery, strFile
Again,
acSpreadsheetTypeExcel12 is for A2007
acSpreadsheetTypeExcel12Xml is for A2010 - 2016.
Are you still having problems?? Here is the Excel file that was created when I filtered by "9HB".