Hi. I thought you said the default value would depend on what was selected in the Combobox? If so, you don't put "London" in the code. Instead, you select "London" from the Combobox, and the code will pick it up for you.
Hi. I thought you said the default value would depend on what was selected in the Combobox? If so, you don't put "London" in the code. Instead, you select "London" from the Combobox, and the code will pick it up for you.
No, I don't think I misunderstood what you asked for. Did you try the code I posted? Since you don't know ahead of time what the user will choose from the Combobox, you can't put it in the code. The code I gave you should put London, if the user selects London, and it should automatically put England, if the user selects England. Give it a try and let us know what happens.
It's actually a little more complicated. You need to add another column to the lookup table to include the City name and you need to include the city name in the RowSource query of the combo. Do not forget to change the column count and column width properties when you add the THIRD column to the RowSource. The code below ASSUMES that CityName is the third field in the RowSource query. It is reverenced as .Column(2) because the columns of the RowSource are a 0-based array. The first column is .column(0) and that is the uniqueID which is also the default or .Value property. The second column which is the CountryName in this case and is referenced as .Column(2) if you need to reference it in code.