不需要红色的代码
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
Dim Parts() As String = .Value.Split("-")
If Parts(0) = DataTables("分类").DataRows(1)("分类") Then
Filter2 = "分类 = '" & Parts(0) & "'"
If Parts.length > 1 Then
Filter2 = Filter2 & " And 明细分类 = '" & Parts(1) & "'"
End If
End If
ElseIf .Value Is Nothing Then
Filter2 = "分类 = '" & DataTables("分类").DataRows(1)("分类") & "'"
End If
End With
改为
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
Dim Parts() As String = .Value.Split("-")
Filter2 = "分类 = '" & Parts(0) & "'"
If Parts.length > 1 Then
Filter2 = Filter2 & " And 明细分类 = '" & Parts(1) & "'"
End If
ElseIf .Value Is Nothing Then
Filter2 = "分类 = '" & DataTables("分类").DataRows(1)("分类") & "'"
End If
End With