Change your code to this:
Function HasCharacter(strData As String) As Boolean If InStr(strData, "/") > 0 Or InStr(strData, ":") > 0 Then HasCharacter = True Else HasCharacter = False End If End Function
The function InStr
returns the position of the string if found, else it returns 0.