|
大虾 Private Sub cmd查询_Click()
Dim Item As MSComctlLib.ListItem, k%
ListView1.ListItems.Clear
Erase ListRows: Erase ListCols '清空数组
For i = 2 To UBound(arr)
If arr(i, 2) Like "*" & ComboBox1.Text And arr(i, 3) Like "*" & ComboBox2.Text And _
arr(i, 7) Like "*" & ComboBox3.Text Then
For j = 4 To 7 '依次检索责任者、文件字号、文件题名、文件日期
If arr(i, j) Like "*" & TextBox1.Text & "*" Then
Set Item = ListView1.ListItems.Add
Item.Text = arr(i, 1)
For k = 2 To UBound(arr, 2)
Item.SubItems(k - 1) = arr(i, k)
Next
Exit For
End If
Next
End If
Next
k = ListView1.ListItems.Count
Label10.Caption = "检索结果:" & IIf(k > 0, "从 " & UBound(arr) - 1 & " 条记录中匹配出 " & k & " 条记录。", "无匹配的记录。")
End Sub,套用你的代码出现类型不匹配,麻烦你看一下是什么原因 |
|