0

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

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by adam_k
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.