V
vepha
Hi Everyone,
I want to move all the imported files to another path instead of deleting.
here is the code i am using.
Private Sub Befehl457_Click()
On Error GoTo Err_Befehl457_Click
Dim strPathFile As String, strFile As String, strPath As String
Dim strTable As String
Dim blnHasFieldNames As Boolean
blnHasFieldNames = True
strPath = "Path"
strTable = "table"
strFile = Dir(strPath & "*.xls")
Do While Len(strFile) > 0
strPathFile = strPath & strFile
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
strTable, strPathFile, blnHasFieldNames
Kill strPathFile
strFile = Dir()
Loop
Exit_Befehl457_Click:
Exit Sub
Err_Befehl457_Click:
MsgBox Err.Description
Resume Exit_Befehl457_Click
End Sub
Thank and best regards
vepha
I want to move all the imported files to another path instead of deleting.
here is the code i am using.
Private Sub Befehl457_Click()
On Error GoTo Err_Befehl457_Click
Dim strPathFile As String, strFile As String, strPath As String
Dim strTable As String
Dim blnHasFieldNames As Boolean
blnHasFieldNames = True
strPath = "Path"
strTable = "table"
strFile = Dir(strPath & "*.xls")
Do While Len(strFile) > 0
strPathFile = strPath & strFile
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
strTable, strPathFile, blnHasFieldNames
Kill strPathFile
strFile = Dir()
Loop
Exit_Befehl457_Click:
Exit Sub
Err_Befehl457_Click:
MsgBox Err.Description
Resume Exit_Befehl457_Click
End Sub
Thank and best regards
vepha