0
我正在使用Access VBA和傳輸文本方法導入數千個CSV文件。我需要將文件名或其格式添加到表中以反映它來自的文件。我已經存儲了變量文件名以便導入它。如何追加代碼以引用「fil」變量的名稱?在Access中導入CSV時設置字段值
With DoCmd
.SetWarnings False
For Each fil In fld.Files
If UCase(Right(fil.Name, 3)) = "CSV" Then
.TransferText acImportDelim, , DestTable, fil.Path, False
End If
Next
.SetWarnings True
End With
真棒!感謝您的幫助。那就是訣竅。 –