If nd.FullPath Like DataTables("分类").DataRows(1)("分类") & "*" Then
Dim d1, d2 As Date
Select Case e.Node.Level
Case 1
If val > "" Then
val = val & " And (" & nms1(0) & " = " & qts1(0) & rts(1) & qts1(0) & ")"
Else
val = nms1(0) & " = " & qts1(0) & rts(1) & qts1(0)
End If
Case 2
d1 = New Date(CInt(rts(2)), 1, 1)
d2 = New Date(CInt(rts(2)), 12, 31)
val = nms1(0) & " = " & qts1(0) & rts(1) & qts1(0) & " And 日期 >= #" & d1 & "# And 日期 <=#" & d2 & "#"
MessageBox.Show(val)
Case 3
d1 = New Date(CInt(rts(2)), CInt(rts(3)), 1)
d2 = New Date(CInt(rts(2)), CInt(rts(3)), Date.DaysInMonth(CInt(rts(2)), CInt(rts(3))))
val = nms1(0) & " = " & qts1(0) & rts(1) & qts1(0) & " And 日期 >= #" & d1 & "# And 日期 <=#" & d2 & "#"
Case 4
d1 = New Date(CInt(rts(2)), CInt(rts(3)), 1)
d2 = New Date(CInt(rts(2)), CInt(rts(3)), Date.DaysInMonth(CInt(rts(2)), CInt(rts(3))))
val = nms1(0) & " = " & qts1(0) & rts(1) & qts1(0) & " And 日期 >= #" & d1 & "# And 日期 <=#" & d2 & "# And 车牌号码 = '" & rts(4) & "'"
Case 5
d1 = New Date(CInt(rts(2)), CInt(rts(3)), 1)
d2 = New Date(CInt(rts(2)), CInt(rts(3)), Date.DaysInMonth(CInt(rts(2)), CInt(rts(3))))
val = nms1(0) & " = " & qts1(0) & rts(1) & qts1(0) & " And 日期 >= #" & d1 & "# And 日期 <=#" & d2 & "# And 车牌号码 = '" & rts(4) & "' And 手机号码 = '" & rts(5) & "'"
End Select
flt3 = "分类= '" & DataTables("分类").DataRows(1)("分类") & "' And " & val
If nd.FullPath Like DataTables("分类").DataRows(2)("分类") & "*" Then
For i As Integer = 1 To rts.length - 1
If val > "" Then
val = val & " And "
End If
val = val & nms2(i - 1) & " = " & qts2(i - 1) & rts(i) & qts2(i - 1)
Next
If flt4 > "" Then
If flt4 > "" Then
flt4 = flt4 & " or (分类 = '" & DataTables("分类").DataRows(2)("分类") & "' And " & val & ")"
Else
flt4 = "分类 = '" & DataTables("分类").DataRows(2)("分类") & "' And " & val
End If
End If
End If
If nd.FullPath Like DataTables("分类").DataRows(3)("分类") & "*" Then
For i As Integer = 1 To rts.length - 1
If val > "" Then
val = val & " And "
End If
val = val & nms3(i - 1) & " = " & qts3(i - 1) & rts(i) & qts3(i - 1)
Next
If val > "" Then
If flt5 > "" Then
flt5 = flt5 & " or (分类 = '" & DataTables("分类").DataRows(3)("分类") & "' And " & val & ")"
Else
flt5 = "分类 = '" & DataTables("分类").DataRows(3)("分类") & "' And " & val
End If
End If
End If
End If
End If
If flt0 > "" Then
If flt > "" Then
flt = flt & " Or "
End If
flt = flt & "(" & flt0 & ")"
End If
If flt1 > "" Then
If flt > "" Then
flt = flt & " Or "
End If
flt = flt & "(" & flt1 & ")"
End If
If flt2 > "" Then
If flt > "" Then
flt = flt & " Or "
End If
flt = flt & "(" & flt2 & ")"
End If
If flt3 > "" Then
If flt > "" Then
flt = flt & " Or "
End If
flt = flt & "(" & flt3 & ")"
End If
If flt4 > "" Then
If flt > "" Then
flt = flt & " Or "
End If
flt = flt & "(" & flt4 & ")"
End If
If flt5 > "" Then
If flt > "" Then
flt = flt & " Or "
End If
flt = flt & "(" & flt5 & ")"
End If
End If
With DataTables("车辆基本信息")
.LoadFilter = flt '设置加载条件
.LoadPage = 0 '加载第一页
.LoadTop = 30 '每页5行
.LoadOrder = "_Identify"
.LoadReverse = True
.Load()
e.Form.Controls("TextBox2").Value = 1 & "/" & .TotalPages
End With