生产目录树按钮代码: Vars("Val") = Vars("Val") + 1 Select Case Vars("Val") Mod 4 Case 1 e.Form.Controls("TreeView1").BuildDataTree("生产工序", "", "工序_班组","剩余天数_开始","图号") Case 2 e.Form.Controls("TreeView1").BuildDataTree("生产工序", "", "工序_班组","剩余天数_结束","图号") Case 3 e.Form.Controls("TreeView1").BuildDataTree("生产工序", "", "工序_班组","图号") Case 0 Tables("生产工序").ApplyFilter = False End Select
NodeMouseClick
用鼠标单击节点后执行代码:
Dim Value() As String Value = e.Node.FullPath.Split("\") Select Case e.Node.Level Case 0 Tables("生产工序").Filter = " [工序_班组] = '" & Value(0) & "' " Case 1 Tables("生产工序").Filter = " [工序_班组] = '" & Value(0) & "' And [剩余天数_开始] = '" & Value(1) & "' or [工序_班组] = '" & Value(0) & "' And [剩余天数_结束] = '" & Value(1) & "' or [工序_班组] = '" & Value(0) & "' And [图号] = '" & Value(1) & "' " Case 2 Tables("生产工序").Filter = " [工序_班组] = '" & Value(0) & "' And [剩余天数_开始] = '" & Value(1) & "'and [图号] = '" & Value(2) & "' or [工序_班组] = '" & Value(0) & "' And [剩余天数_结束] = '" & Value(1) & "'and [图号] = '" & Value(2) & "' " End Select 红色这段不能执行,并提示错误: 此主题相关图片如下:未命名.bmp