hi all
i have some code that i use to import data from excel
but want to be able to get the selected filename add it to another table called tblexcelfilename once the import is done
any help much appreciated
shane
i have some code that i use to import data from excel
Code:
Dim SelectedFile As String
Dim FilePicker As FileDialog
Dim SQLdelete As String
Set FilePicker = Application.FileDialog(msoFileDialogFilePicker)
FilePicker.AllowMultiSelect = False
FilePicker.Filters.Add "Excel", "*.xls*", 1
FilePicker.InitialFileName = "C:\Users\"
FilePicker.Title = "Please Select the Excel Data..."
FilePicker.Show
If FilePicker.SelectedItems.Count <> 0 Then
SelectedFile = FilePicker.SelectedItems(1)
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblExcelImport", SelectedFile, True, "A4:E"
MsgBox ("The data has been successfully loaded")
End If
End Sub
but want to be able to get the selected filename add it to another table called tblexcelfilename once the import is done
any help much appreciated
shane