Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help: Reading Files in a folder on Network machine not using FSO.

Status
Not open for further replies.

ckwizard77

Programmer
Jan 8, 2003
29
US
I need help looping through a folder and Reading Files on Network machine not using FSO.

This is what I have so far but I receive an error stating:
The microsoft Jet Engine could not find the object test.txt. Make sure the object exists and you spell its name and the path name correctly.

Dim strFile As String
Dim strFolderName As String

strFolderName = "\\Pa-TestBox\D$\Program Files\test_FedExExportFile\"
strFile = Dir(strFolderName & "*.txt", vbNormal)

Do While (Len(strFile) > 0)
DoCmd.TransferText acImportDelim, "Test Import Access Specification", "TestExport", strFile
'set directory to look for next text file
strFile = Dir
Loop

 
DoCmd.TransferText acImportDelim, "Test Import Access Specification", "TestExport", strFolderName & strFile

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Excellent that worked.

I knew it was something simple but it kept eluding me.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top