Every time the below code is ran Error Code: 13 Type Mismatch is reported.
If Not Len(Dir(Me.ImageURL)) = 0 Then
Application.FollowHyperlink (Me.ImageURL)
End If
This only occurs when Me.ImageURL is equal to Null. Thus I attempted the following with no success.
If Not Len(Dir(Me.ImageURL)) = 0 And Not Nz(Me.ImageURL, "") = "" Then
Application.FollowHyperlink (Me.ImageURL)
End If
CodePudding user response:
Forget the If statements. Just use the Nz
function.
Application.FollowHyperlink Nz(Me.ImageURL, "")
Your particular problem, if you want to know, is Dir(Me.ImageURL)
. I'm guessing Dir
can't handle a Null value.