要这样合成条件,如
Dim flt As String = "1=1"
If dr("第一列") = nothing Then
flt &= " and 第一列 is null"
else
flt &= " and 第一列 = '" & dr("第一列") & "'"
End If
If dr("第二列") = nothing Then
flt &= " and 第二列 is null"
flt &= " and 第二列 = '" & dr("第二列") & "'"
msgbox(flt)