Try something like this:
Set rstNames = CurrentDb.openrecordset("tblNames"
Open "C:\OutputFile.txt" For Output As 1
Write #1, "ID", "Surname", "Forename"
With rstNames
.MoveFirst
While not .EOF
Write #1, !ID, !Surname, !Forename
.MoveNext
Wend
.Close
End With
Close #1
You will get a file that looks something like:
"ID","Surname","Forename"
1,"Smith","John"
2,"Smith","Joan"
etc
If you don't want a comma delimited file (CSV) then try Print #1 instead of Write #1
Enjoy
Peter