建议用listview '填充List的条目 Private Sub List_Input() Dim i As Integer Dim phsbz As String With RS_temp If .State = adStateOpen Then .Close End If .ActiveConnection = adoCN .CursorLocation = adUseClient .CursorType = adOpenForwardOnly .LockType = adLockReadOnly .Source = "select staffname from dm_users where deptcode='" & cDeptCode & "'" .Open 'List_Clear If .BOF = False And .EOF = False Then '有记录 i = 1 Do While .EOF = False ListView1.ListItems.Add , , .Fields("staffname").Value i = i + 1 .MoveNext Loop End If End With End Sub
我没用过listview.@_@
麻烦详细说一下,是不是第三方控件?
工程->部件->microsoft windows common controls 6.0
点击应用,listview就有了。呵!
在Presentation下拉框中就有您要的东东
'填充List的条目
Private Sub List_Input()
Dim i As Integer
Dim phsbz As String
With RS_temp
If .State = adStateOpen Then
.Close
End If
.ActiveConnection = adoCN
.CursorLocation = adUseClient
.CursorType = adOpenForwardOnly
.LockType = adLockReadOnly
.Source = "select staffname from dm_users where deptcode='" & cDeptCode & "'"
.Open
'List_Clear
If .BOF = False And .EOF = False Then
'有记录
i = 1
Do While .EOF = False
ListView1.ListItems.Add , , .Fields("staffname").Value
i = i + 1
.MoveNext
Loop
End If
End With
End Sub