You will need to rewrite them as
If InStr(...) > 0 Then
'....
' I will run smoothly
'
End If
instead of simply
If InStr(...) Then
' ....
' I will cause problems when run
'
End If
VBA will not be able to correctly interpret the second sample I've written. The comparison construction should be explicitly stated.
A Note on NULL
InStr returns Null
if either of the String inputs are NULL
. Hence, if it better to put this enclosed in a function wrapper that returns a boolean value and performs all validation internally to avoid any nasty run-time surprises.
Ref: http://office.microsoft.com/en-us/access-help/instr-function-HA001228857.aspx
That doesn't mean it will necessarily cause problems, but it's one of those things to consider.
In this particular question, the problem isn't null
and can be corrected easily with just rewriting the line with comparison explicitly specified, so the information is for the community in general.
A Note on Type conversions
Btw, unlike other languages, in VBA, while False
translates to 0, True
doesn't translate to 0, but to 255 (2s complement for -1, all 1s). Just to note.
Edit: corrected the bit mixup