We ran into a problem with one line of your solution. We corrected it as
follows and everything works now. Thank for your help.
Here's the revised code:
Function WriteToText(ByVal tableName As String, ByVal exportLocation As
String)
Dim rsR As DAO.Recordset
Dim S As String
Dim ErrorCode As Long
Set rsR = CurrentDb.OpenRecordset(tableName)
Do Until rsR.EOF
S = S & rsR.Fields(0).Value
rsR.MoveNext
Loop
rsR.Close
ErrorCode = WriteToFile(S, exportLocation)
If ErrorCode <> 0 Then
MsgBox "Something Went Wrong"
Else
MsgBox "Export Complete"
End If
End Function