How to output a table to a text file but on seperate lines and no headings.

PuddinPie

Registered User.
Local time
Yesterday, 21:06
Joined
Sep 15, 2010
Messages
149
Hello,

The title says it all. I don't know if its possable but im trying to output from a table to a text file but I want the table's columns on individual lines and no headings.

For example:
I have a table that has two columns A and B. This table will only ever have on record in it at any time and I want to output it to a text file.
The text file should have no headers and column A will appear under column B.

Like; A
B

Thank you
 
This will write the output to the immediate window.
If this is what you need, then we can adjust to put it to a file.

Sub Oct19()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("Select a,b from YourTablename")
Do While Not rs.EOF
Debug.Print rs!a & vbCrLf & rs!B
rs.MoveNext
Loop
End Sub
 

Users who are viewing this thread

Back
Top Bottom