I would like that the button does the following, with an If function:
- search in the predefined directory if the file exists, then show mgb "File found" and opens directory (this works fine with Application.followhyperlink)
- if the file does not exists shows mgb "File not found"
I tried with this:
Code:
If Dir("Z:\ArchivioN" & Me.Testo495 & ".docx" & ".xlsx") = "" Then
MsgBox "File found"
Application.FollowHyperlink ("Z:\ArchivioN")
else
MsgBox "File not found"
End If
This shows anyway the mgb "File found" even if I change some fields in order to see if it does not find the file