The following VBA subroutine is the eventual solution:
Private Sub Export_Click() Dim whereClause As String ' Generate our WHERE clause based on form values whereClause = GenerateFilterClause ' If we have no filter, export nothing If IsEmptyString(Nz(whereClause)) Then Exit Sub End If Dim query As String query = "SELECT DISTINCTROW Contacts.* " & _ " FROM Contacts " & _ " INNER JOIN Applications " & _ " ON Contacts.ContactID = Applications.ContactID " & _ " WHERE " & whereClause & ";" Dim filename As String filename = "c:\test.xls" ' Placeholder query already in the database Dim queryName As String queryName = "FilterExportQuery" ' Update the placeholder with the created query CurrentDb.QueryDefs(queryName).SQL = query ' Run the export DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, queryName, filename End Sub