I am building a form in Access 2007 that has an unbound ComboBox. It's record source is a query:
SELECT EventName, EventID FROM Events ORDER BY EventName
ComboBox.Column(0) = EventName
ComboBox.Column(1) = EventID
I have the ComboBox set to only display the EventName (by making the width of Column(1) = 0). I would like to set the selected item in the dropdown by EventID. For example: I have an Event where the EventID = 12 and the EventName = "My Event". I want to be able to set the selected item in the ComboBox by using the EventID of 12. When I'm finished, I want the ComboBox.Value to be the EventName and if I drop down the list the proper item will be highlighted.
This would seem a fairly natural request for a combobox - to be able to search by an index but I'm not having much luck figuring out the solution.
Thanks in advance for any help - much appreciated.
BK
SELECT EventName, EventID FROM Events ORDER BY EventName
ComboBox.Column(0) = EventName
ComboBox.Column(1) = EventID
I have the ComboBox set to only display the EventName (by making the width of Column(1) = 0). I would like to set the selected item in the dropdown by EventID. For example: I have an Event where the EventID = 12 and the EventName = "My Event". I want to be able to set the selected item in the ComboBox by using the EventID of 12. When I'm finished, I want the ComboBox.Value to be the EventName and if I drop down the list the proper item will be highlighted.
This would seem a fairly natural request for a combobox - to be able to search by an index but I'm not having much luck figuring out the solution.
Thanks in advance for any help - much appreciated.
BK