Open Folder and limit Files to Show

ajb_1976

Registered User.
Local time
Today, 01:56
Joined
Feb 25, 2005
Messages
34
Hello,

currently I use the following code to open a folder and display the contents within it

Dim strLocation
strLocation = "W:\folder_path\"

Shell "C:\WINDOWS\explorer.exe """ & strLocation & "", vbNormalFocus

This works fine but what I want to do next is limit the files that are shown.

Within the folder path I have a load of pdf documents with the following naming structure - "module1 - Joe Bloggs.pdf", "module1 - John Smith.pdf", module2 - John Smith.pdf" and so on.

Can I add something to the code to allow me to only show those files containing the word "smith" in the title? (I have a field on my form called ctlsearch that will contain the relevant "text" to search on.

Many Thanks,
Alan
 
Where does this fit with Access?
If you have a database that "points" to these files - that is if you have info about the files (including the name) in your table, you could run a query on file names to select the set of records you need; then open those specific files.
 
the database is designed to allow us to keep records or all of our employees driver CPC training and the dates that they have sat and completed the relevant modules and courses. for each module passed they receive a certificate which is then saved into the "folder path" directory.

What I am trying to do is have a button from within their record on the db that opens the certificate directory and only displays their documents. I can go down the route of having an individual directory for each employee but thats not really a raod I wanted to go down.

Thanks
 

Users who are viewing this thread

Back
Top Bottom