Transfer Text

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
 
J

Jim Bunton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top