ApplePirate
Programmer
Im sure this has been answered before, but i cant any threads today that will solve this easy problem.
I have a load of files which i recieve daily, i need to import them into a database, but i want to do it all in one go.
i have been tinkering with this peice of code but it only seems to import the first file and then stops:-
Function JGNoTelData()
Dim FileName As String
DoCmd.SetWarnings False
FileName = Dir("//supdox02/data/shared/bip/services/ecs_winback/loading area/*.txt"
If FileName <> "" Then
Do Until FileName = ""
DoCmd.TransferText acImportDelim, "JG Data Import Specification", "JG no tel data", "//supdox02/data/shared/bip/services/ecs_winback/loading area/" & FileName, False, ""
FileName = Dir()
Loop
End If
MsgBox ("Import Complete!"
DoCmd.SetWarnings True
End Function
I know ive seen another bit of code on here which uses a count function based on the number of files in the directory e.g.
j = file count
for i = 1 to j
transfer text
next i
someone please help i cant go home early until ive done this
I have a load of files which i recieve daily, i need to import them into a database, but i want to do it all in one go.
i have been tinkering with this peice of code but it only seems to import the first file and then stops:-
Function JGNoTelData()
Dim FileName As String
DoCmd.SetWarnings False
FileName = Dir("//supdox02/data/shared/bip/services/ecs_winback/loading area/*.txt"
If FileName <> "" Then
Do Until FileName = ""
DoCmd.TransferText acImportDelim, "JG Data Import Specification", "JG no tel data", "//supdox02/data/shared/bip/services/ecs_winback/loading area/" & FileName, False, ""
FileName = Dir()
Loop
End If
MsgBox ("Import Complete!"
DoCmd.SetWarnings True
End Function
I know ive seen another bit of code on here which uses a count function based on the number of files in the directory e.g.
j = file count
for i = 1 to j
transfer text
next i
someone please help i cant go home early until ive done this