Спасибо за ответ, Рахул. Я нашел следующий код на другом форуме, который делает большую часть того, что я хочу. Он импортирует все CSV-файлы из исходной папки и добавляет их в таблицу в Access. Однако в будущем я просто хочу добавлять новые CSV, которые добавляются в папку, а не все CSV каждый раз. Любые идеи о том, как я могу изменить код, чтобы сделать это?
Спасибо,
Sub Import_CSV() «Измененный WillR - www.willr.info (декабрь 2004)
Const strPath As String = "C:\ImportFolder\" 'Directory Path
Dim strFile As String 'Filename
Dim strFileList() As String 'File Array
Dim intFile As Integer 'File Number
'Loop through the folder & build file list
strFile = Dir(strPath & "*.csv")
While strFile <> ""
'add files to the list
intFile = intFile + 1
ReDim Preserve strFileList(1 To intFile)
strFileList(intFile) = strFile
strFile = Dir()
Wend
'see if any files were found
If intFile = 0 Then
MsgBox "No files found"
Exit Sub
End If
'cycle through the list of files & import to Access
'creating a new table called MyTable
For intFile = 1 To UBound(strFileList)
DoCmd.TransferText acImportDelimi, ImportSpec, _
"Raw Data", strPath & strFileList(intFile), -1
'Check out the TransferSpreadsheet options in the Access
'Visual Basic Help file for a full description & list of
'optional settings
Next
MsgBox UBound(strFileList) & " Files were Imported"
End Sub
Использование' метод docmd.transferspreadsheet' с таймером мероприятие. Просмотрите эти ссылки [Link1] (https://access-programmers.co.uk/forums/showthread.php?t=224155), [Link2] (http://access-excel.tips/access-vba-cocmd- transferspreadsheet /) – harun24hr