This probably means that the field in the database is Null. You could add this line before the problematic line:
If isNull( myString ) Then Exit Function
In case that doesn’t work, you could also try changing the problematic line into this:
If "" & myString <> "" Then