-
1
- #1
ChiTownDiva
Technical User
Good Morning....
I'm trying to import multiple DAT files in a particular directory into an Access database using an import specification.
The problem is that sometimes there may be 10 or there may be 50--it varies.
After the file has been imported, it still can have the same name--that's fine, but I need to figure out a way to get each one in there.
A couple of people on tek-tips have helped me out--so far this is what I've got:
Function Import()
With Application.FileSearch
.NewSearch
.LookIn = "C:\valuerpt\test"
.SearchSubFolders = True
.FileName = "*.txt"
.MatchTextExactly = True
End With
With Application.FileSearch
If .Execute() > 0 Then
For I = 1 To .FoundFiles.Count
DoCmd.TransferText acImportDelim, "Full Service Import Specification", "TempTable", .FoundFiles(I), True
Next I
End If
End With
I want to be able to just throw each file into Access, one right after the other--no appending--just import each file in the folder. "TempTable" just keeps getting replaced and that's not what we want.
Any help would be greatly appreciated.
Thanks in advance for your assistance.
ChiTownDiva![[ponytails2] [ponytails2] [ponytails2]](/data/assets/smilies/ponytails2.gif)
I'm trying to import multiple DAT files in a particular directory into an Access database using an import specification.
The problem is that sometimes there may be 10 or there may be 50--it varies.
After the file has been imported, it still can have the same name--that's fine, but I need to figure out a way to get each one in there.
A couple of people on tek-tips have helped me out--so far this is what I've got:
Function Import()
With Application.FileSearch
.NewSearch
.LookIn = "C:\valuerpt\test"
.SearchSubFolders = True
.FileName = "*.txt"
.MatchTextExactly = True
End With
With Application.FileSearch
If .Execute() > 0 Then
For I = 1 To .FoundFiles.Count
DoCmd.TransferText acImportDelim, "Full Service Import Specification", "TempTable", .FoundFiles(I), True
Next I
End If
End With
I want to be able to just throw each file into Access, one right after the other--no appending--just import each file in the folder. "TempTable" just keeps getting replaced and that's not what we want.
Any help would be greatly appreciated.
Thanks in advance for your assistance.
ChiTownDiva
![[ponytails2] [ponytails2] [ponytails2]](/data/assets/smilies/ponytails2.gif)