Using the following code to link from a MS Access form to the related file in a network folder and open it. The code works great for it successfully opens the correct folder based upon the keyword (which is a textbox on the form). The issue I have which is probably unique only to this project is that some records in Access form relate to 2 files in the network folder not just one. Currently the code opens only one file yet I would like the command to open both files upon the button click. Thanks!
The code is based upon a snippet from this experts-exchange question:
Private Sub Command2_Click()
Dim strFileName As String
strFileName = Me.txtDocID2
Dim vItem As Integer, strPath As String
.filename = strFileName
.LookIn = "\\server\ProjectTest\"
.SearchSubFolders = True
If .Execute > 0 Then
For vItem = 1 To .FoundFiles.Count
strPath = .FoundFiles(vItem)
MsgBox "File not found"
k strPath, False, True