Textbox Hyperlink Error

E

Ella

I have a textbox where I enter the full path for a file.
This is the double click event but if the textbox is null I get a runtime
error:
Private Sub File_DblClick(Cancel As Integer)

Application.FollowHyperlink Me.File

End Sub

Is there a way of fixing this.

Ella
 
E

Ella

Fantastic
Thanks very much

Ella


Damon Heron said:
Consider the on error event:
Private Sub File_DblClick(Cancel As Integer)
On Error GoTo ErrorHandler
Application.FollowHyperlink Me.File
Exit Sub
ErrorHandler:
msgbox " Field cannot be blank!", vbcritical
Resume Next
end sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top