本来在afterload 过滤掉 编号为空的数据,
Tables("form_table5").Filter = "[报告编号] <> '""'"
但查询后没生成报告编号的又显示出来了,应该怎么才能把没有报告编号的也过滤掉呢?
查询代码如下:
Dim Filter As String
With e.Form.Controls("combobox6")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "检测部门 = '" & .Value & "'"
End If
End With
With e.Form.Controls("dtp7")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "报告日期 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("dtp8")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "报告日期 <= #" & .Value & "#"
End If
End With
Dim txt As String = e.Form.Controls("TextBox12").Text
Dim tbl As Table = Tables("form_Table5")
If txt = "" Then
tbl.Filter = ""
Else
txt = "'%" & txt & "%'"
tbl.Filter = "委托单位 Like " & txt & " "
End If
If Filter > "" Then
Tables("form_table5").Filter = Filter
End If