I have a form with a text field and a command button. The text field contains the path to a document on a computer. For example: C:\Users\Steve\Documents\C
Then the user clicks on the command button to open that file. The on click code for the command button is:
Private Sub cmdOpen_Click()
Dim strFileName As String
strFileName = Me.txtLocationPathandLink.Value
But if the file can't be found I need a custom message to appear like “File Not Found. Please contact the administrator.”
How can I change the code to make this message appear?