LERNWebmaster
asked on
Uploading multiple data files
Can someone please tell me how to get this upload to work? I have put the code below (in my database is it a module). The issue is, I get the file uploaded 4 times (even though I only want it once) and if I have more than one file pending upload, it only process the first file.
Is it possible the issue is from the switchboard and not this module?
Any advice is greatly appreciated.
THANKS!
Is it possible the issue is from the switchboard and not this module?
Any advice is greatly appreciated.
THANKS!
Public Results As Integer
Option Compare Database
Function ImportJPMCDebitTransactions()
Dim strFile As String
Dim strFolderName As String
Dim fso, fldr, s
Set fso = CreateObject("Scripting.FileSystemObject")
strFolderName = "C:\Documents and Settings\rlschluk\Desktop\Cash Database\JPMC Debits - to process\"
strProcessedFolderName = "C:\Documents and Settings\rlschluk\Desktop\Cash Database\JPMC Debits - Processed\"
strFile = Dir(strFolderName & "*.csv")
strFileCurrentlyProcessing = strFolderName & strFile
Set fldr = fso.GetFolder(strFolderName)
Do While (Len(strFile) > 0)
DoCmd.TransferText acImportDelim, "JPMC DEBITS Import Specification", "JPMC Debits", strFileCurrentlyProcessing
'set directory to look for next text file
strFile = Dir
Loop
fso.CopyFolder "C:\Documents and Settings\rlschluk\Desktop\Cash Database\JPMC Debits - to process", "C:\Documents and Settings\rlschluk\Desktop\Cash Database\JPMC Credits - Processed"
fso.DeleteFolder "C:\Documents and Settings\rlschluk\Desktop\Cash Database\JPMC Debits - to process"
fso.CreateFolder "C:\Documents and Settings\rlschluk\Desktop\Cash Database\JPMC Debits - to process"
End Function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your help!!!
Open in new window