此主题相关图片如下:ug%$)0j$}sg}iwcb`)s@8.png
如果 仅两个条件就不会报错 比如
Dim Filter As StringDim dr As DataRow = e.Node.DataRow '获取生成此节点的行
If e.Node.name <> "显示所有" Then
Select Case e.Node.Level
Case 0
Filter = "[车间] = '" & dr("车间") & "'"
Case 1
Filter = "[车间] = '" & dr("车间") & "' And [班别] = '" & dr("班别") & "'"
End Select
End If
三个条件就报错,加替换符也没用
Dim Filter As String
Dim dr As DataRow = e.Node.DataRow '获取生成此节点的行
If e.Node.name <> "显示所有" Then
Select Case e.Node.Level
Case 0
Filter = "[日期] = '" & dr("日期") & "'"
Case 1
Filter = "[日期] = '" & dr("日期") & "' And [班别] = '" & dr("班别") & "'"
Case 2
Filter = "[日期] = '" & dr("日期") & "' and [车间] = '" & dr("车间") & " And [班别] = '" & dr("班别") & "'"
End Select
End If
filter = filter.Replace("#","[#]")
此主题相关图片如下:5v7$d$nwj`w}{~ib3okmn.png
MessageBox.Show(filter)
tb.Filter = Filter