Textbox Hyperlink Error

  • Thread starter Thread starter Ella
  • Start date Start date
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
 
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
 
Back
Top