danikuper
Registered User.
- Local time
- Today, 08:20
- Joined
- Feb 6, 2003
- Messages
- 147
Hi there,
I'm running Access 2000 and have the following problem:
In my form, I have a text box (F_Path) with the file path to a word document. The code I'm using to open it works great, but when there's no path or an invalid path, it brings up an unfriendly error message with the options to "stop" or "debug".
I tried several things to customize the message and stop the procedure of opening the file but nothing works... after the error message, it opens the last file I had opened!!!!
Really strange... well, here's the code I'm using. I hope someone can point me to the right direction, this must be something very simple to fix.
Thanks!!!!
Private Sub cmdOpenFile_Click()
Dim ctl As CommandButton
On Error GoTo Err_cmdOpenFile_Click
Set ctl = Me!cmdOpenFile
With ctl
.HyperlinkAddress = [F_Path]
.Hyperlink.Follow
End With
Exit Sub
Err_cmdOpenFile_Click:
MsgBox ("File not found. Check path and make sure you have a mapped drive to the folder.")
Exit Sub
End Sub
I'm running Access 2000 and have the following problem:
In my form, I have a text box (F_Path) with the file path to a word document. The code I'm using to open it works great, but when there's no path or an invalid path, it brings up an unfriendly error message with the options to "stop" or "debug".
I tried several things to customize the message and stop the procedure of opening the file but nothing works... after the error message, it opens the last file I had opened!!!!
Really strange... well, here's the code I'm using. I hope someone can point me to the right direction, this must be something very simple to fix.
Thanks!!!!
Private Sub cmdOpenFile_Click()
Dim ctl As CommandButton
On Error GoTo Err_cmdOpenFile_Click
Set ctl = Me!cmdOpenFile
With ctl
.HyperlinkAddress = [F_Path]
.Hyperlink.Follow
End With
Exit Sub
Err_cmdOpenFile_Click:
MsgBox ("File not found. Check path and make sure you have a mapped drive to the folder.")
Exit Sub
End Sub