I tried the following code to import a series of data files into an
Access table, but i keep getting Syntax errors. I'm running it from a
Macro using the RunCode action with the ImportFiles() function. Can
someone give me a pointer on how to correct this. Thanks in advance.
Code:
Function ImportFiles()
Dim strPath As String
Dim strFile As String
strPath = "C:\Database\"
strFile = Dir$(strPath & "*.txt")
Do While Len(strFile) > 0
TransferText (acImportDelim, "SampleData3import", "MyTable",
strFile, True)
\\i tried with DoCmd.TransferText as well, with no luck
strFile
strFile = Dir$
Loop
End Function