Check if file has already been loaded
Posted on 2008-10-30
I use this VB code to load a test file into an access table. How can I add to this to check if I have already loaded the file.
Private Sub cmdImport_Click()
If IsNull(Me.txtFileName) Or Len(Me.txtFileName & "") = 0 Then
MsgBox "please select the excel file"
'DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Import", Me.txtFileName, True
DoCmd.TransferText acImportDelim, "ImportSpecification", "STG_Load", Me.txtFileName, False
MsgBox "Your file has sucessfully loaded"
'Me.txtFileName = Null