Hello,
I have to import monthly, files that were once *.csv but due to commas in
addresses, the interface program was changed to dump tab delimited. Now my
code is not finding the files in the folder? The code is below - can anyone
help? (The files still are named with the extension of *.csv)
Function Import_Records()
'On Error GoTo Import_Records_Err
'Delete the all records in MONTHLY_IMPORTS table
'Call Delete_the_Monthly_Imports_Data
Dim db As DAO.Database
Dim strInputDir, strImportFile As String, strTableName As String
Dim strFileExt As String
Dim strSQL As String
Dim strSelectFdr As Module
'strSelectFdr = Select_Year
' the pathname of the folder that contains the files for import
strInputDir = "S:\Council\APPS\GENETICS\CURRENT\"
' the file extension for the type of files to import
strFileExt = ".csv"
' the destination table in the database
strTableName = "Genetics Imports"
strImportFile = Dir(strInputDir & "\*" & strFileExt)
Set db = CurrentDb
Do While Len(strImportFile) > 0
DoCmd.TransferText acImportDelim, "Genetics Import", strTableName,
strImportFile, False
strImportFile = Dir
Loop
' Beep
MsgBox "The Import has Completed", vbOKOnly, ""
--
Message posted via http://www.accessmonster.com