I'm using the following code with a button... How can I make it look in another folder location too.
Basically, if the file is in one folder or the other folder. I want to be able to look in either one.
Dim strFileName As String
Dim strFileExists As String
strFileName = "\\folder123\" & [Mdid] & "\Invoices\" & [Minvoiceno] & ".pdf"
strFileExists = Dir(strFileName)
If strFileExists = "" Then
MsgBox "The selected file doesn't exist"
Else
Application.FollowHyperlink "\\folder123\" & [Mdid] & "\Invoices\" & [Minvoiceno] & ".pdf"
End If
End Sub
Basically, if the file is in one folder or the other folder. I want to be able to look in either one.
Dim strFileName As String
Dim strFileExists As String
strFileName = "\\folder123\" & [Mdid] & "\Invoices\" & [Minvoiceno] & ".pdf"
strFileExists = Dir(strFileName)
If strFileExists = "" Then
MsgBox "The selected file doesn't exist"
Else
Application.FollowHyperlink "\\folder123\" & [Mdid] & "\Invoices\" & [Minvoiceno] & ".pdf"
End If
End Sub