


I want to export the table to a text file with selected field name and the delimiter as "|||" between each value. StrPrintList = strPrintList & strDelim & strQuote & _ StrQuote = IIf(blnQuoteText And (fld.Type = dbText Or fld.Type = dbMemo), """", "") StrPrintList = Mid$(strPrintList, Len(strDelim) + 1) If MsgBox("Overwrite " & strExportTo & "?", vbQuestion + vbYesNo, "Export Query") = vbYes ThenĮlseIf MsgBox("Append rows to " & strExportTo & "?", vbQuestion + vbYesNo, "Export Query") = vbNo Then ' blnHasFieldNames - Boolean - (optional) - True (default) to export field names as first line ' blnQuoteText - Boolean - True to enclose text or memo data in quotes ' strDelim - Text - delimiter character(s) to separate fields ' strExportTo - Text- path to file to export to ' strQuery - Text - name of query to be exported Optional blnHasFieldNames As Boolean = True) Name of thee query into the function, or it would not be difficult to amend the function to export a table:įunction ExportToText(strQuery As String, _ To export a table, either create a query based on the table and pass the The following function is designed for exporting the result set of a query to a text file, and allows the delimiter character(s) to be passed into the function as an argument.
