编译错误:“Filter”不是“String”的成员。
错误代码:e.form.tablename.Filter = ""
Dim s As String = e.Form.Controls("CheckedComboBox筛选树").Text
Dim Colstr() As String
Dim qts As String() = {"'","#",""}
Dim trv As WinForm.TreeView = e.Sender
Dim flt As String = ""
Dim nd As WinForm.TreeNode
Dim pd As WinForm.TreeNode
Dim notchecked As Integer = 0
Colstr = s.split("|")
For i As Integer = 0 To Colstr.Length - 1
'If form.tablename.Cols.Contains(Colstr(i)) = False Then
If Tables(e.form.tablename).Cols.Contains(Colstr(i)) = False Then
If trv.Nodes.Count > 0 Then
trv.Nodes.Clear()
End If
e.Form.Controls("CheckedComboBox筛选树").Text = "选择筛选列(最好包括拼音)"
Return
End If
Next
If e.Node.Name = "显示所有行" Then
If e.Node.Checked = True Then
For Each nd In trv.AllNodes
If nd.Name <> "显示所有行" Then
nd.Checked = False
End If
Next
e.form.tablename.Filter = ""
Else
For Each nd In trv.AllNodes
nd.Checked = False
Next
e.form.tablename.Filter = (1 = 2)
End If
trv.CollapseAll
Return
Else
trv.AllNodes(0).Checked = False
End If
For Each nd In e.node.allNodes
nd.Checked = False
Next
pd = e.Node.ParentNode
Do While pd IsNot Nothing
pd.Checked = False
pd = pd.ParentNode
Loop
For Each nd In trv.AllNodes
If nd.Checked Then
Dim rts() As String = nd.FullPath.Split("\")
Dim val As String = ""
For i As Integer = 0 To rts.length - 1
If Tables(e.form.tablename).Cols.Contains(Colstr(i)).IsString Then
If rts(i) <> "空" Then
If val > "" Then
val = val & " And "
val = val & Colstr(i) & " = " & qts(0) & rts(i) & qts(0)
Else
val = val & Colstr(i) & " = " & qts(0) & rts(i) & qts(0)
End If
ElseIf rts(i) = "空" Then
If val > "" Then
val = val & " And "
val = val & Colstr(i) & " Is Null"
Else
val = val & Colstr(i) & " Is Null"
End If
End If
ElseIf Tables(e.form.tablename).Cols.Contains(Colstr(i)).IsDate Then
If rts(i) <> #0001-1-1 0:00:00# Then
If val > "" Then
val = val & " And "
val = val & Colstr(i) & " = " & qts(1) & rts(i) & qts(1)
Else
val = val & Colstr(i) & " = " & qts(1) & rts(i) & qts(1)
End If
ElseIf rts(i) = #0001-1-1 0:00:00# Then
If val > "" Then
val = val & " And "
val = val & Colstr(i) & " Is Null"
Else
val = val & Colstr(i) & " Is Null"
End If
End If
ElseIf Tables(e.form.tablename).Cols.Contains(Colstr(i)).IsNumeric Then
If rts(i) <> 0 Then
If val > "" Then
val = val & " And "
val = val & Colstr(i) & " = " & qts(2) & rts(i) & qts(2)
Else
val = val & Colstr(i) & " = " & qts(2) & rts(i) & qts(2)
End If
ElseIf rts(i) = 0 Then
If val > "" Then
val = val & " And "
val = val & Colstr(i) & " Is Null"
Else
val = val & Colstr(i) & " Is Null"
End If
End If
ElseIf Tables(e.form.tablename).Cols.Contains(Colstr(i)).IsBoolean Then
If rts(i) <> False Then
If val > "" Then
val = val & " And "
val = val & Colstr(i) & " = " & qts(0) & True & qts(0)
Else
val = val & Colstr(i) & " = " & qts(0) & True & qts(0)
End If
ElseIf rts(i) = False Then
If val > "" Then
val = val & " And "
val = val & Colstr(i) & " = " & qts(0) & False & qts(0)
Else
val = val & Colstr(i) & " = " & qts(0) & False & qts(0)
End If
End If
End If
Next
If flt > "" Then
flt = flt & " Or (" & val & ")"
Else
flt = val
End If
notchecked + = 1
End If
Next
If flt > "" AndAlso notchecked > 0 Then
e.form.tablename.Filter = flt
Else
e.form.tablename.Filter = (1 = 2)
End If