Does anyone know how to delete the duplicates in one column once opening the data query in excel?
Here is my code:
Private Sub Command56_Click()
Dim strFile As String
Dim objXL As Object
Dim objWB As Object
strFile = CurrentProject.Path & "\Test.xlsx"
If Len(Dir(strFile)) > 0 Then
Kill strFile
End If
DoCmd.TransferSpreadsheet acExport, 10, _
"qryHere", CurrentProject.Path & "\Test.xlsx", True
Set objXL = CreateObject("Excel.Application")
objXL.Visible = True
Set objWB = objXL.Workbooks.Open(strFile)
objXL.UserControl = True
Set objXL = Nothing
strFile = CurrentProject.Path & "\Test.xlsx"
MsgBox "Data export completed", vbInformation, "Completed"
End Sub
Here is my code:
Private Sub Command56_Click()
Dim strFile As String
Dim objXL As Object
Dim objWB As Object
strFile = CurrentProject.Path & "\Test.xlsx"
If Len(Dir(strFile)) > 0 Then
Kill strFile
End If
DoCmd.TransferSpreadsheet acExport, 10, _
"qryHere", CurrentProject.Path & "\Test.xlsx", True
Set objXL = CreateObject("Excel.Application")
objXL.Visible = True
Set objWB = objXL.Workbooks.Open(strFile)
objXL.UserControl = True
Set objXL = Nothing
strFile = CurrentProject.Path & "\Test.xlsx"
MsgBox "Data export completed", vbInformation, "Completed"
End Sub