Hello Folks,
I have below code and it works absolutely perfect. However, I have one minor issue and I've been racking my head on it to fix it. What below code does is, it retrieves the ComboBox list from Access database. However, when I select any item from the list, the drop down closes and It doesn't display the selection in ComboBox.Value. You know what I mean?
When I open the dropdown it again retrieves the list which is right but doesn't save the selection in Combobox.Value. Please help!
Private Sub ComboBox4_DropButt*******()
cnn.Open "Provider = Microsoft.ACE.oledb.12.0; data source= " & ThisWorkbook.Path & "\" & "Database_SDET.accdb" & ";Jet OLEDB:Database Password=L@stMinute14;"
Qry = "SELECT [Full_Name] FROM Login_Details"
rst.Open Qry, cnn, adOpenKeyset, adLockOptimistic
rst.MoveFirst
With Admin_Page.ComboBox4
.Clear
Do
.AddItem rst![Full_Name]
rst.MoveNext
Loop Until rst.EOF
End With
rst.Close
cnn.Close
End Sub
I have below code and it works absolutely perfect. However, I have one minor issue and I've been racking my head on it to fix it. What below code does is, it retrieves the ComboBox list from Access database. However, when I select any item from the list, the drop down closes and It doesn't display the selection in ComboBox.Value. You know what I mean?
When I open the dropdown it again retrieves the list which is right but doesn't save the selection in Combobox.Value. Please help!
Private Sub ComboBox4_DropButt*******()
cnn.Open "Provider = Microsoft.ACE.oledb.12.0; data source= " & ThisWorkbook.Path & "\" & "Database_SDET.accdb" & ";Jet OLEDB:Database Password=L@stMinute14;"
Qry = "SELECT [Full_Name] FROM Login_Details"
rst.Open Qry, cnn, adOpenKeyset, adLockOptimistic
rst.MoveFirst
With Admin_Page.ComboBox4
.Clear
Do
.AddItem rst![Full_Name]
rst.MoveNext
Loop Until rst.EOF
End With
rst.Close
cnn.Close
End Sub