Hi everyone,
I want to find a string on another string, then i google code and copy it. After that i modify to suit my situation like this:
and when i run it inside an IIF function in expression of a query, the error "94invalid use of null" keep appear...
What is my problem ? how can I fix this ?
please help me,
thank you.
I want to find a string on another string, then i google code and copy it. After that i modify to suit my situation like this:
Code:
Public Function IsInArray(stringtocompare As Variant, valueToFind As Variant) As Boolean
On Error GoTo Err_F
' checks if valueToFind is found in arr, no loop!
If IsNull(stringtocompare) = False Then
IsInArray = False
Else
If stringtocompare = valueToFind Then
IsInArray = True
Else
If InStr(1, stringtocompare, ",", vbTextCompare) = 0 Then
IsInArray = False
Else
arrtocompare = Split(stringtocompare, ",")
IsInArray = (UBound(Filter(arrtocompare, valueToFind)) > -1)
End If
End If
End If
Exit_F:
Exit Function
Err_F:
MsgBox Err.Number & " " & Err.Description
Resume Exit_F
End Function
What is my problem ? how can I fix this ?
please help me,
thank you.
Comment