01-12-04, 12:19 #1Registered User
- Join Date
- Jan 2004
Unanswered: FileSearch.FileName Invalid Procedure Call or argument
I have a program that does a simple filesearch (code shown below) It has been in use and working for my users for almost three years. I have one user that is getting an "Invalid Procedure Call or Argument" when getting to the line that says '.FileName = "*.mck"' She is running on a Win2K pro machine. My program uses Access2000 Runtime.
I did a quick search on the internet and have found a couple of other people who have gotten this problem, but nobody has a solution. Can anybody help me?
Set Db = CurrentDb Db.Execute ("qryDeleteCourseInfo") Set rst = Db.OpenRecordset("SELECT * FROM tblCourseInfo") With Application.FileSearch .NewSearch .SearchSubFolders = True .FileName = "*.mck" .LookIn = GetFileNamePart(DBFullPath, True) If .Execute > 0 Then For I = 1 To .FoundFiles.Count rst.AddNew rst![CourseName] = GetFileName(.FoundFiles(I)) rst![CoursePath] = GetFileNamePart(.FoundFiles(I), True) rst.Update Next I End If End With rst.Close Db.Close
01-13-04, 03:12 #2Registered User
- Join Date
- Sep 2002
- South Wales
May be missing references on the machines in question perhaps?Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull
12-03-09, 19:58 #3Moderator
- Join Date
- Dec 2004
- Madison, WI
This code looks very, very similar to the code I have in this example (except it does it for xls files)
but I think the cause of your error might be due to something else. Perhaps re-install MSAccess if it's only on 1 computer but not others. Otherwise, it might be permission or something else related.
I'd log in as yourself on that computer to see if it's login based (ie. profile/user) or whether it's computer/software based (ie. MSAccess installation problem).
Since it only happens for 1 user/computer (and not others), I'd suspect that it's not a problem with the code itself. (otherwise I might think that it didn't like a specific file name.)
Last edited by pkstormy; 12-03-09 at 20:09.Expert Database Programming
MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)