The command FileSearch does not excits in ACCESS 2007, my code is as follow:

How do I import this filein a different code?

Public Sub Import_Labolink()
Dim sourcefile, destinationfile, miscresults As String
Dim i, N, m, o As Integer
'Dim mFileSearch As New myFileSearch ' New code for filesearch


N = 1


With Application.FileSearch
.LookIn = Labolink_PATH
.FileName = Labolink_FILE

If .Execute() > 0 Then

For i = 1 To .FoundFiles.count

'Import text file and to temporary table and backup, delete original from incoming folder

If .FoundFiles(i) = Labolink_PATH & Labolink_FILE Then
If MsgBox("Die leêrnaam: testset.txt, is GEVIND!" + Chr(13) + "Click, OK om data oor te dra, Cancel om data oordrag te STOP!", vbOKCancel) = vbOK Then

DoCmd.TransferText acImportDelim, "Lims Import Specification1", "NIR temp table Unity", .FoundFiles(i), True
'DoCmd.TransferSpreadsheet acImport, 8, "NIR-IMPORTS-FINALFEEDS", "C:\NIR IMPORT\FinalFeeds\lims_export.xls", False
sourcefile = .FoundFiles(i)
destinationfile = backup_filename()
move_file sourcefile, destinationfile
merge_to_clean
End
Else
End
End If
Else
MsgBox "Die BRON leêrnaam: Testset.DAT is NIE gevind!" + Chr(13) + "Something is WRONG..."
End If


Next i
Else
MsgBox "Die BRON leêrnaam: TEXT FILE met ALLE FINAL FEEDS data, is gevind!" + Chr(13) + "Something is WRONG..."
End If

End With

End Sub

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.