Agent909
asked on
How to programatically change ComboBox selection
After a record is saved in my application, a combobox is refilled to include the new item. How do I programatically move the position of the combobox to the new record?
Thanks!
Thanks!
ASKER
Actually, the list is sorted first, so it won't be the last item.
ASKER
The values in the combobox are:
Description - what's shown
RecordID - the index
Description - what's shown
RecordID - the index
ASKER
I discovered that the values in my combobox are objects. Here's some code I used to test this. So, there's got to be a way to access the recordID to set the combobox's SelectedValue.
Dim obj As WebPage
For Each obj In cboSites.Items()
' this does work
Debug.Print(obj.SiteDescription)
' this will hang
If obj.SiteDescription = "Google" Then
cboSites.SelectedValue = obj.RecordID
End If
Next
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Your code is sending me in the right direction. Thank you!
Open in new window