title: Access VBA Save File Multiple Filter
body: <p>I want to save a query in either xls or xlsx. I can get the drop down of 2 filters working but when i run an If statement to either save the document as acSpreadsheetTypeExcel9 or 10 it does not see the strfilter as "Excel 97-2003 (.xls)" or "Excel 2007+ (.xlsx)" and always goes to the ELSE. Any help would be appreciated to get this working properly.
  Any questions please let me know.
  Cheers.</p>
  
  <pre><code>strFilter = ahtAddFilterItem(strFilter, "Excel 97-2003 (.xls)", "*.xls")
  strFilter = ahtAddFilterItem(strFilter, "Excel 2007+ (.xlsx)", "*.xlsx")
  strSaveFileName = ahtCommonFileOpenSave( _
                                  OpenFile:=False, _
                                  Filter:=strFilter, _
                  Flags:=ahtOFN_OVERWRITEPROMPT Or ahtOFN_READONLY)
  If strFilter = "Excel 97-2003 (.xls)" Then
      DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "xlsquery", strSaveFileName
  Else
      DoCmd.TransferSpreadsheet acExport, 10, "xlsxquery", strSaveFileName
  End If
  </code></pre>