Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application FileSearch LookIn problem

Status
Not open for further replies.

snyperx3

Programmer
May 31, 2005
467
US
I'm building a program that finds files that begin with a certain string, and adding them to a list. It's not working on a few computers, but does on others. I've found the problem to be with the LOOKIN line. When i set the fs.lookin it doesnt actually change the folder.

Code:
Set fs = Application.FileSearch
fs.lookin = "g:\archiveap"
MsgBox (fs.lookin)
fs.Filename = "APACP" & ComboReportname.Value & "_" & ListYear.Value & ListMonth.Value & "*"
fs.Execute
For i = 1 To fs.FoundFiles.Count
    lstFiles.AddItem Dir(fs.FoundFiles(i))
Next i

i put that message box to print the actual folder its searching. On most of the pcs it shows "g:\archiveap" like its supposed to. On others, the folder stays set to "My Documents". It is also the only function of FileSearch that didn't automatically capitalize when i typed it in: "lookin" instead of "Lookin". All pcs have Access 2002 with the references to Access 10.0 Object Library. Any Ideas?

Thanks


-Pete
 
You could use WMI. Might be overkill, but it might work on all machines too.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top