Private Sub ImportButton_Click()
'Option Compare Database
'Option Explicit
'Function DoImport()
MsgBox "This process will take a longer time - Please wait for another message to display", _
vbExclamation, _
"Attention! Attention!! Attention!!!"
Dim strPathFile As String
Dim strFile As String
Dim strPath As String
Dim strTable As String
Dim blnHasFieldNames As Boolean
' Change this next line to True if the first row in CSV worksheet
' has field names
blnHasFieldNames = True
' Path to the folder that contains the CSV files
strPath = "P:\Lenoir Projects\Fiber\Labels_DB\NestedData\"
' Tablename where the data are to be imported
strTable = "tlbStickersData"
strFile = Dir(strPath & "*.csv")
Do While Len(strFile) > 0
strTable = Left(strFile, Len(strFile) - 4)
strPathFile = strPath & strFile
DoCmd.TransferText acImportDelim, , "tlbStickersData", strPath & strFile, True
' Uncomment out the next code step if you want to delete the
' CSV files after been imported
'Kill strPathFile
strFile = Dir()
Loop
Dim FSO As Object
Dim SourceFileName As String, DestinFileName As String
Set FSO = CreateObject("Scripting.Filesystemobject")
SourceFileName = "P:\Lenoir Projects\Fiber\Labels_DB\NestedData\*.csv"
DestinFileName = "P:\Lenoir Projects\Fiber\Labels_DB\NestedData\Imported\"
FSO.MoveFile Source:=SourceFileName, Destination:=DestinFileName
MsgBox "Files Successfully Imported", _
vbInformation, _
"Congrats! Congrats!! Congrats!!!"
End Sub