30-40 years ago, I was an expert in MS access when it was version 2.0, and I am sure I used DoCmd.TransferText without an export specification ands with SQL constructed in code dynamically to export selected results, buit the latest version of Access seems to demand a pre-saved export specification which doesn't let code dynamically select what records to export. Google searches still seem to offer the solution I would have used, such as Dim qQuery As DAO.QueryDef Dim sSQL As String
Set qQuery = CurrentDb.CreateQueryDef(TMP_EXPORT_QUERYDEF)
sSQL = "Select * from [Export Stock Easy Formated Price Data] where [Date] = " & (format some date)
qQuery.SQL = sSQL
DoCmd.TransferText acExportQuery, , "ExportQuery", "d:\temp\file1.txt"
but it doesn't work because it now demands an export specification, so something has changed.
Can't find a current solution, so can anyone please tell me how do I now dynamically export selected results
Access is still aa great product, but like everything else Microsoft, especially Word, the product has got too smart for it's own good.