提示: 无法在 System.Boolean 和 System.String 上执行“=”操作。
有一个信息表,其中 是否查看 与是否下载 是逻辑列。
想用合成条件筛选,报告出错,代码如下:
Dim filter As String
Dim sts() As String = {"发送人", "接收人", "信息内容"}
For Each st As String In sts
Dim val As String = e.Form.Controls(st).value
If val > "" Then
val = val.Replace("*", "[*]")
If filter = "" Then
filter = st & " like '*" & val & "*'"
Else
filter = filter & " and " & st & " like '*" & val & "*'"
End If
End If
Next
Dim c As WinForm.ComboBox = e.Form.Controls("是否下载")
Dim t As WinForm.ComboBox = e.Form.Controls("是否查看")
Filter = c.Name & " = '" & e.Sender.Value & "'"
If t.Value > "" Then
Filter = filter & " and " & t.Name & " = '" & t.Value & "'"
End If
If c.Value > "" Then
Filter = filter & " and " & c.Name & " = '" & c.Value & "'"
End If
Tables("信息记录").Filter = filter