I have the following code:
Dim strNextCSV As String
strNextCSV = Dir("Z:\\Accounting\\dchristman\\ICE_200907\\*.csv")
Do While strNextCSV <> ""
' MsgBox strNextCSV
DoCmd.TransferText acImportDelim, "ICEImportSpecification", "ICE_Import", strNextCSV, False
strNextCSV = Dir()
Loop
This code works sometimes and then decides not to work other times. It is driving me nuts. The commented out msgbox always shows the csv file and the loop is working perfectly. I originally did not have the False at the end of the transfertext but added it on the hope that this would make a difference. It did not make a difference. I even tried moving to a shorter path in the hope that this was the problem but that didn't work. The transfertext seems to have a mind of its own. Like I said, sometimes it works and sometimes it doesn't. Can someone give me a clue to what is wrong? Thanks for any help in advance.
Dave
Dim strNextCSV As String
strNextCSV = Dir("Z:\\Accounting\\dchristman\\ICE_200907\\*.csv")
Do While strNextCSV <> ""
' MsgBox strNextCSV
DoCmd.TransferText acImportDelim, "ICEImportSpecification", "ICE_Import", strNextCSV, False
strNextCSV = Dir()
Loop
This code works sometimes and then decides not to work other times. It is driving me nuts. The commented out msgbox always shows the csv file and the loop is working perfectly. I originally did not have the False at the end of the transfertext but added it on the hope that this would make a difference. It did not make a difference. I even tried moving to a shorter path in the hope that this was the problem but that didn't work. The transfertext seems to have a mind of its own. Like I said, sometimes it works and sometimes it doesn't. Can someone give me a clue to what is wrong? Thanks for any help in advance.
Dave