How to Change Combobox Recordset Source
Posted on 2004-04-25
I'm using the Recordset property off a combobox to populate the combobox from an ADO recordset. I do this for a lot of my quasi-static lookup lists by saving persistent ADO recordset files on the front ends of the data base. It works well, except for when I try to change the recordset and then re-set the combobox Recordset property. (Simple example: change a State lookup list from the 51 USA states to the 13 Canadian provinces/territories based on a country selection). The combobox doesn't seem to "take" the new values of the changed recordset. Its dropdown list either displays all blanks or simply displays the orginal recordset values.
I've tried to use ADO methods (like .Delete, .AddNew and .Update) directly on the combobox recordset object. I've also tried to first set the combobox recordset object to Nothing, and then set a new/changed recordset to the combobox recordset object. Neither seems to do the trick, nor other variations.