automatically Import all *.tab files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a folder that receives files from an automatic download throughout the
day. Each file is uniquely named but all end with *.tab. I am using Access
2000 on a windows xp computer.

I am not a programmer, but is there some code that I can cut and paste into
a command button to import into an access table and delete all files in a
specific folder that fit the *.tab criteria?
 
BLTibbs said:
I have a folder that receives files from an automatic download throughout the
day. Each file is uniquely named but all end with *.tab. I am using Access
2000 on a windows xp computer.

I am not a programmer, but is there some code that I can cut and paste into
a command button to import into an access table and delete all files in a
specific folder that fit the *.tab criteria?

Yes. But it won't work without some modification. Hopefully you can figure
out where ;-)

Private Sub Command1_Click
Dim strFile As String

strFile = Dir("*.tab")

Do While strFile <> ""
DoCmd.TransferText acImportDelim, , "MyTable", strFile
Kill strFile
strFile = Dir
Loop

End Sub
 
Below is the code I have in my system (thanks!) but I always get an MS jet
engine error stating that it cannot find the first file in the list and no
data gets imported. What am I missing?

Private Sub Command7_Click()
Dim strFile As String

strFile = Dir("c:\electroniclibrary\data\pendingalibris\*.tab")

Do While strFile <> ""
DoCmd.TransferText acImportDelim, , "AlibrisImportTable", strFile
Kill strFile
strFile = Dir
Loop

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

Back
Top