troubleshooting Question

How to access subfolder files in MS Access

Avatar of geekynerd
geekynerd asked on
Microsoft Access
14 Comments1 Solution408 ViewsLast Modified:
Hi given below is my code. Its for opening pdf files stored in a folder where each pdf file is linked to each record. But the main folder also contains sub folders and my database is unable to open the linked pdf files stored in the subfolder. The database record and the pdf files are inter related through "site_name" of the record and the pdf file names.

Modification of the code for desired result would be appreciated.
Private Sub qwerty_Click()
On Error GoTo Err_qwerty_Click
   Dim sFile As String
   sFile = "D:\SAP - Private Sites LA\" & Me.Site_Name & ".pdf"
 If Dir$(sFile) <> "" Then
       FollowHyperlink sFile
      MsgBox "Cannot locate file " & sFile
    Exit Sub
    MsgBox Err.Description
    Resume Exit_qwerty_Click
    End If
End Sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 14 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros