All,
I have an older program that I have been asked make some updates to. I first wanted to make sure the current code was functioning so ran some tests. Things are working fine except for the code that imports new data into the database. When I attemp this I get a Run time error '5' invalid procedure call or argument. The code in question is:
Public Function GetDataFiles()
Set fs = New Scripting.FileSystemObject
Dim i As Integer
Set drCurrent = fs.Drives(Mid(Me.txtDataFolder.Value, 1, 1)) '"C"
*** Set flCurrent = drCurrent.RootFolder.SubFolders(Mid(Me.txtDataFold er.Value, 4, Len(Me.txtDataFolder.Value) - 4))
For Each fi In flCurrent.Files
i = i + 1
DoEvents
MsgBox i & ": " & fi.Name
Me.txtNumber.Value = i
Me.txtFilename.Value = fi.Name
'import the file into the AllStock table
ImportStockDataFromFile (fi)
DoEvents
Next
End Function
The line that the debugger highlights is noted by the ***. It also wraps around here but not in the actual code. Does anybody see anything that could be causing this? I would appriciate any suggestions. TIA