Something along the lines of the following untested air code should work:
Dim dbCurr As DAO.Database
Dim rsCurr As DAO.Recordset
Dim fldCurr As DAO.Field
Dim intFile As Integer
Dim curTotal As Currency
Dim strFile As String
Dim strOutput As String
strFile = "C:\Output.txt"
intFile = FreeFile()
sngTotal = 0.0
Set dbCurr = CurrentDb()
Set rsCurr = "SELECT * FROM MyTable ORDER BY 1"
If rsCurr.EOF = False
Open strFile For Output As #intFile
' Make a row consisting of the field names,
' separated by commas
For Each fldCurr In rsCurr
strOutput = fldCurr.Name & ","
Next fldCurr
' Write the field name row to the file as a header
' (The Left$(...) removes the extraneous comma from the end)
Print #intFile Left$(strOutput, Len(strOutput) - 1)
Do While rsCurr.EOF = False
curTotal = curTotal + rsCurr!Cost
' Concatenate the values for the row, separating
' them by commas
For Each fldCurr In rsCurr
strOutput = fldCurr & ","
Next fldCurr
' Write the details of the current row to the file
Print #intFile Left$(strOutput, Len(strOutput) - 1)
' Move to the next row in the recordset
rsCurr.MoveNext
Loop
' Write the total cost to the file as a footer
Print #intFile "Total cost = " & curTotal
End If
' Clean up after yourself...
Close #intFile
rsCurr.Close
Set rsCurr = Nothing
Set dbCurr = Nothing