I've also had problems with:
so I don't use itCode:If Not IsNull(Me.txtFilterMainName) Then
but never had problems with the following type of code which you left out of your answer
At times I also useCode:If Nz(Me.txtFilterMainName,"") <>"" Then
Your belt & braces LenTrimNz approach is certainly covering all bases!Code:If Len(Me.txtFilterMainName & vbNullString) > 0