i tried to populate combobox with access it show me blank data on combo box.
Code:
Private Sub Comboyear_Change()
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim str As String
Dim i As Integer
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Test.mdb;Jet OLEDB:Database Password=123"
str = "select year from test"
rs.Open str, con, adOpenStatic, adLockOptimistic
i = 0
While Not rs.EOF
Comboyear.List(i) = rs.Fields(0)
rs.MoveNext
i = i + 1
Wend
rs.Close
con.Close
Set rs = Nothing
Set con = Nothing
End Sub