Open folder from form (1 Viewer)

mitchem1

Registered User.
Local time
Today, 16:54
Joined
Feb 21, 2002
Messages
153
I am a novice programmer at best so hope this question is an easy one. I have a form that has a button on it called View PDF. When clicked, it grabs the data from one of the fields on the form (PermitNumber) and then opens up the related PDF document. The code for this is below. What I need to do now is rather than open a PDF, simply open a folder (holding multiple related PDF docs). The name of the folder will be the same as one of the fields on the form. For example, the form field may be: Contractor: Smith Engineering Group. The name of the folder would be: Smith Engineering Group. If anyone can help, thanks in advance.

Private Sub cmdViewPdf_Click()

Dim myfile

'Creates a "myfile" variable
'save pfd target to variable
'all pdf's should be under their
'respective "permit number"

myfile = "O:\Progdev\PROJSUP\Scanned Permits\7D-" & PermitNumber & ".pdf"

'set the command buttons hyperlink
'property to target the permit
'currently being viewed

Me.[cmdViewPdf].HyperlinkAddress = myfile

End Sub
 
Local time
Today, 16:54
Joined
Mar 4, 2008
Messages
3,856
Code:
Sub Whatever()
Shell "explorer C:\Smith Engineering Group\"
End Sub
 

Users who are viewing this thread

Top Bottom