I have a button on a form that, when clicked, will open an explorer winder to a specific directory where I have PDF files stored.
Each record on the form has it's own ClientNumber that is part of the name of each PDF file. Clients have multiple PDF files and all PDF files begin with Client # and then the ClientNumber for that record and more info after that (ie: Client #SIF2111JS - Smith, John; Invoice #123456).
I would like to be able to click the ViewPDFFiles button and have the explorer open up and ONLY show the PDF files for that specific ClientNumber.
How can I create a "filter" when I open explorer? I tried adding \Client #" & Me.ClientNumber & "*.*" to my path but that didn't work.
Any suggestions?
Code:
Private Sub ViewPDFFiles_Click()
Dim OpenPDFfolder As Variant, myPath As String
myPath = "C:\Documents and Settings\myPDFfolder"
If Dir(myPath, vbDirectory) <> "" Then OpenPDFfolder = Shell("Explorer.exe " & myPath, 1)
End Sub
Each record on the form has it's own ClientNumber that is part of the name of each PDF file. Clients have multiple PDF files and all PDF files begin with Client # and then the ClientNumber for that record and more info after that (ie: Client #SIF2111JS - Smith, John; Invoice #123456).
I would like to be able to click the ViewPDFFiles button and have the explorer open up and ONLY show the PDF files for that specific ClientNumber.
How can I create a "filter" when I open explorer? I tried adding \Client #" & Me.ClientNumber & "*.*" to my path but that didn't work.
Any suggestions?