Catching hyperlink error

  • Thread starter Thread starter RipperT
  • Start date Start date
R

RipperT

Hello,

I have a text box's double click event set to open a specific URL using the
FollowHyperlink method. Sometimes their server is down or otherwise times
out and I get a run time error in Access. How can I catch this?

Thank you.

Rip
 
You should be able to identify the error codes numbers generated when these
events occur and then trap them within your error handler.

Sub xxxxx()
On error goto err_Handler

Your code here

Err_Handler:
If err.number=number_generated_by_specific_issue then
Do something, display message, Resume Next, Exit Sub
Else if err.number=another_error then

End if
End Sub

I think you get the idea. this is simply the basic approach, there are main
variations. If you want to get really fansy, you can even ping the server to
see if it is available and then ajust the behavior of your event based on
this. But you'll have to look around for the code to achieve that!

Daniel
 
Back
Top