你这个需求简单,但你做复杂了。
不过按你的做法,只要添加一个判断就可以了。
If Not IsNull(Me.表2姓名) Then
If Me.表2姓名 = "null" or Me.表2姓名 = "is null"Then
strWhere = strWhere & "isnull([表2姓名]) and "
Else
strWhere = strWhere & "([表2姓名]='" & Me.表2姓名 & "') And "
End If
End If 作者: 六月雪 时间: 2018-12-15 17:51