You will need a bit of code for this...
================================================== ==========
Public Function pfunExportTable(strTableName As String, strFilePath As String, blnFieldNames As Boolean)
Dim strFileDestination As String
If Right(strFilePath, 1) <> "\" Then strFilePath = strFilePath & "\"
strFileDestination = strFilePath & strTableName & "_" & Format(Now(), "yymmddhhss") & ".xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, strTableName, strFileDestination, blnFieldNames
End Function
================================================== ==========
This should do the trick for you. Put this into its own module and then you can call it from code or from a macro.
|