我combobox.DropDown
在更改事件中使用方法时遇到问题,将仅显示 1 个带有滚动条的结果以显示其他结果。
Private Sub emp_name_Change()
Call Connect_to_db
strSQL = "SELECT [Name] , [ID] FROM Table2 where [Name] Like '%" & emp_name & "%' Order By [Name]; "
rs.Open strSQL, cn
If rs.bof = True Or rs.EOF = True Then
MsgBox ("No records found")
Else
rs.MoveFirst
End If
With emp_name
.Clear
Do While Not rs.EOF
.AddItem rs.Fields(0).Value
rs.MoveNext
Loop
End With
Call Close_db
emp_name.DropDown
End Sub