Hello,
I have the below macro i'm using to upload an excel file into a table in access. I want there to be a prompt before the upload happens to confirm the number of records that are being added...
Also for the same code I want a way for there to be a prompt if the user tries to upload a file with the same name a previously uploaded file. is this possible?
I have the below macro i'm using to upload an excel file into a table in access. I want there to be a prompt before the upload happens to confirm the number of records that are being added...
Also for the same code I want a way for there to be a prompt if the user tries to upload a file with the same name a previously uploaded file. is this possible?
Code:
Private Sub Command0_Click() 'INPUT PENDING REPORT
Dim objXLApp As Object
Dim File_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. Import cancelled"
Exit Sub
Else
DoCmd.TransferSpreadsheet acImport, , "Pending Report - Cumulative", File_import, True
MsgBox "Import completed"
End If
End Sub
Last edited: