Also, you can use the GetString() method of ADODB.Recordset as seems in the sample bellow:
Code:
Function RecordsInText(strSQL As String) As String
'Need to set a reference to Microsoft ActiveX Data Objects x.x Library.
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open strSQL, CurrentProject.Connection, adOpenStatic, adLockReadOnly
If rs.RecordCount > 0 Then
RecordsInText = rs.GetString(, , vbTab, vbCrLf)
End If
rs.Close
Set rs = Nothing
End Function
Sub BuildTextFile()
Dim strText As String
Dim f As Long
strText = RecordsInText("SELECT Field1, Field2 FROM tblTest") & String(100, "~") & vbCrLf
strText = strText & RecordsInText("SELECT Field3, Field4, Field5, Field6 FROM tblTest") & String(100, "~") & vbCrLf
strText = strText & RecordsInText("SELECT Field7, Field8, Field9, Field10 FROM tblTest")
f = FreeFile
Open "C:\TestFile.txt" For Output As #f
Print #f, strText
Close #f
End Sub
Replace the text in red with the actual names of your table and test it.