jeffreylewis
New member
- Local time
- Today, 02:35
- Joined
- Sep 17, 2020
- Messages
- 15
Hi Guys
Can anoyone see what is wrong with this code?
Its showing the message box every time even on the good urls and does not Exit Sub as required
Thanks
Private Sub CmdView_Click()
On Error GoTo ErrorHandler
Application.FollowHyperlink txtUrl
ErrorHandler:
MsgBox "Dodgy Url Link on Target site", vbCritical, "Oops!"
Me.txtUrl.SetFocus
DoCmd.RunCommand acCmdCopy
Exit Sub
End Sub
Can anoyone see what is wrong with this code?
Its showing the message box every time even on the good urls and does not Exit Sub as required
Thanks
Private Sub CmdView_Click()
On Error GoTo ErrorHandler
Application.FollowHyperlink txtUrl
ErrorHandler:
MsgBox "Dodgy Url Link on Target site", vbCritical, "Oops!"
Me.txtUrl.SetFocus
DoCmd.RunCommand acCmdCopy
Exit Sub
End Sub