Hello,
So I have 2 Tables
-Daily_cumulative
-tbl_Import
I have a button macro in my form which when pressed prompts me for the file I want to upload. The data is uploaded to Daily_cumulative.
tbl_Import should display for me the name (or path) of the file I just uploaded as well as date/time.
Is there a simply VBA to make this happen?
Here is the code I am using to do my import:
So I have 2 Tables
-Daily_cumulative
-tbl_Import
I have a button macro in my form which when pressed prompts me for the file I want to upload. The data is uploaded to Daily_cumulative.
tbl_Import should display for me the name (or path) of the file I just uploaded as well as date/time.
Is there a simply VBA to make this happen?
Here is the code I am using to do my import:
Code:
Private Sub Upload_Pull_Report_BUTTON_Click()
Dim objXLApp As Object
Dim File_import As Variant
Dim tbl_Import As Variant
Set objXLApp = CreateObject("excel.application")
' Ask the user for the file name to open.
File_import = objXLApp.GetOpenFilename
If File_import = False Then
MsgBox "No file selected. Upload cancelled"
Exit Sub
Else
DoCmd.TransferSpreadsheet acImport, , "dlyPULL_Cumulative", File_import, True
MsgBox "Upload completed"
End If
End Sub