Transfer Text

  • Thread starter Thread starter Jim Bunton
  • Start date Start date
J

Jim Bunton

The code below executes without error
The query definitely returns records
BUT the file intended to receive the text remains stubornly empty!

[access 2000, WindowsXP - fully updated]

Private Sub ExportAsText_Click()
On Error GoTo Err_ExportAsText_Click
Dim FileName As String

FileName = Me.DestinationPath
DoCmd.TransferText acExportDelim, , "MyReceiveFile", FileName, True

Exit_ExportAsText_Click:
Exit Sub

Err_ExportAsText_Click:
MsgBox Err.Description
Resume Exit_ExportAsText_Click

End Sub
 
Dear Roger,
Thanks for your response to my posting.
You hit the nail on the head - it was indeed a problem with the file name.

Jim BUnton

Roger Carlson said:
If you put a debug line after assigning the FileName value:
Debug.Print Filename
and a break point on the DoCmd line, what is the value of FileName?

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L


Jim Bunton said:
The code below executes without error
The query definitely returns records
BUT the file intended to receive the text remains stubornly empty!

[access 2000, WindowsXP - fully updated]

Private Sub ExportAsText_Click()
On Error GoTo Err_ExportAsText_Click
Dim FileName As String

FileName = Me.DestinationPath
DoCmd.TransferText acExportDelim, , "MyReceiveFile", FileName, True

Exit_ExportAsText_Click:
Exit Sub

Err_ExportAsText_Click:
MsgBox Err.Description
Resume Exit_ExportAsText_Click

End Sub
 
Back
Top