Office 2000 and ACCESS 97 (1 Viewer)

Late4Supper

Registered User.
Local time
Yesterday, 23:55
Joined
Sep 16, 2002
Messages
32
This is a weird one. I have an app that runs fine on a NT machine and ACCESS97, runs fine on a 2000 machine and converted to ACCESS XP, but generates a Run Time error (5) on a 2000 machine running ACCESS 97. The error bounces back on
.filename = "*.pdf" .

Here's the full code


Function CompareFilesForCopy2()
Dim fs
Dim i

Set fs = Application.FileSearch
With fs
.LookIn "\\Cornishrex04Apps\CalligoDMS\output\Underwriting\complete\"
.FileName = "*.pdf" 'run time error(5) gets generated here If .Execute > 0 Then
' MsgBox "There were " & .FoundFiles.Count & " file(s) found."
For i = 1 To .FoundFiles.Count
If Not FileDateOlderThan180days(.FoundFiles(i)) Then
copypdfFiles2 .FoundFiles(i)
End If
Next i
Else
MsgBox "There were no files found in underwriting complete."
End If
End With
End Function
 

simongallop

Registered User.
Local time
Today, 04:55
Joined
Oct 17, 2000
Messages
611
Sorry can't help but can confirm that Acc97 on 2000 is not a healthy app! My personal gripe is on graphical reports where the graphs are not showing the true data (even when the graph is forced by code to update!)

Good luck though suggest keeping the same OS and Office products together as otherwise there are dll conflicts
 

John.Woody

Registered User.
Local time
Today, 04:55
Joined
Sep 10, 2001
Messages
354
I have copied your code to test but I think I'm missing a reference

.LookIn " D:\Data\John\CellnetInvoices\"

is not supported. If you let me know I can test on my pc Win2000 Office 2000 and Access97

John
 
Last edited:

Late4Supper

Registered User.
Local time
Yesterday, 23:55
Joined
Sep 16, 2002
Messages
32
I can get past the .Lookin ( it points to a Lan drive, it was wrapped when I pasted it to the Post.
 

John.Woody

Registered User.
Local time
Today, 04:55
Joined
Sep 10, 2001
Messages
354
I know I've changed the LAN location for one of mine, but I can't get past the line previously posted which I think is a problem with a reference you're using and I'm not.

If you want me to test it further you need to let me know which references you have ticked so that I can proceed to the rest of the code.
 

Late4Supper

Registered User.
Local time
Yesterday, 23:55
Joined
Sep 16, 2002
Messages
32
Visual Basic for Applications
Microsoft Access 8.00 Object Library
Microsoft DAO 3.51 Object Library
 

John.Woody

Registered User.
Local time
Today, 04:55
Joined
Sep 10, 2001
Messages
354
L4S

I still can't get the folowing line to run
.LookIn " D:\Data\John\CellnetInvoices\"

but below is an alternative which runs to the msgbox returning a count of one, if it helps.


Function CompareFilesForCopy2()
Dim fs
Dim i
Dim fl As String

Set fs = Application.FileSearch

fl = " D:\Data\John\CellnetInvoices\*.pdf"
With fs

If fs.Execute > 0 Then
MsgBox "There were " & .FoundFiles.Count & " file(s) found."
For i = 1 To .FoundFiles.Count
'If Not FileDateOlderThan180days(.FoundFiles(i)) Then
'copypdfFiles2 .FoundFiles(i)
'End If
Next i
Else
MsgBox "There were no files found in underwriting complete."
End If
End With
End Function
 

John.Woody

Registered User.
Local time
Today, 04:55
Joined
Sep 10, 2001
Messages
354
This works better ;)

Function CompareFilesForCopy2()
Dim i

With Application.FileSearch
.NewSearch
.LookIn = "D:\Data\John\CellnetInvoices\"
.SearchSubFolders = False
.FileName = ".pdf"

If .Execute > 0 Then
MsgBox "There were " & .FoundFiles.Count & " file(s) found."
For i = 1 To .FoundFiles.Count
'If Not FileDateOlderThan180days(.FoundFiles(i)) Then
'copypdfFiles2 .FoundFiles(i)
'End If
Next i
Else
MsgBox "There were no files found in underwriting complete."
End If
End With
End Function
 

Late4Supper

Registered User.
Local time
Yesterday, 23:55
Joined
Sep 16, 2002
Messages
32
I never would have believed it was because of the Wild Card (*).

Thanks
 

Users who are viewing this thread

Top Bottom