Hi,
I would like to store a lot of scand documents in an Access97 table.
I've used the following code in the onclick event for my load documents button and it works fine, but I would like to amend it to stop files that have already been loaded from being loaded again.
I know I could just manually move the documents into a new directory once they've been loaded, but I wan't to keep things simple for the users and wont be arround to hold their hands if they forget.
Of course a coded method of moving the files would also solve the problem
But my VB skills are still being developed and I've yet to come accross a way to do this.
Thanks in advance.
Roal
I would like to store a lot of scand documents in an Access97 table.
I've used the following code in the onclick event for my load documents button and it works fine, but I would like to amend it to stop files that have already been loaded from being loaded again.
I know I could just manually move the documents into a new directory once they've been loaded, but I wan't to keep things simple for the users and wont be arround to hold their hands if they forget.
Of course a coded method of moving the files would also solve the problem
But my VB skills are still being developed and I've yet to come accross a way to do this.
Thanks in advance.
Roal
Code:
Private Sub cmdLoadOLE_Click()
Dim MyFolder As String
Dim MyExt As String
Dim MyPath As String
Dim MyFile As String
Dim strCriteria As String
MyFolder = Me!SearchFolder
MyPath = MyFolder & "\" & "*." & [SearchExtension]
MyFile = Dir(MyPath, vbNormal)
Do While Len(MyFile) <> 0
[DocumentPath] = MyFolder & "\" & MyFile
[OLEFile].Class = [OLEClass]
[OLEFile].OLETypeAllowed = acOLEEmbedded
[OLEFile].SourceDoc = [DocumentPath]
[OLEFile].Action = acOLECreateEmbed
MyFile = Dir
DoCmd.RunCommand acCmdRecordsGoToNext
Loop
End Sub
[\Code]