Hi,
I have code written which imports excel data to a access table and I want to validate it to prevent importing the duplicates. How can I do that?
Thanks.
My code is below,
I have code written which imports excel data to a access table and I want to validate it to prevent importing the duplicates. How can I do that?
Thanks.
My code is below,
Code:
Public Function FolderSelection() As String
Dim objFD As Object
Dim strOut As String
strOut = vbNullString
Set objFD = Application.FileDialog(3)
If objFD.Show = -1 Then
strOut = objFD.SelectedItems(1)
End If
Set objFD = Nothing
FolderSelection = strOut
strChoice = FolderSelection
If Len(strChoice) > 0 Then
Me.test = strChoice
DoCmd.TransferSpreadsheet _
TransferType:=acImport, _
SpreadsheetType:=acSpreadsheetTypeExcel9, _
TableName:="All_Detail", _
FileName:=strChoice, _
HasFieldNames:=True
Else
Me.test = " "
End If
End Function