Public Sub TestSub()
Dim rst As ADODB.Recordset
Dim intFile As Integer
Dim NotFirst As Boolean
Set rst = New ADODB.Recordset
Set rst.ActiveConnection = CurrentProject.Connection
rst.Open "qryTest"
intFile = FreeFile
Open CurrentProject.Path & "\output.txt" For Output As intFile
Do Until rst.EOF
If NotFirst Then
Print #intFile, ";";
Else
NotFirst = True
End If
Print #intFile, rst.Fields("FamilyName");
rst.MoveNext
Loop
rst.Close
Close intFile
End Sub
Where 'qryTest' is your query, and 'FamilyName' is the name of the field you
want to export, and 'output.txt' is the name of the file you want to export
to.