I looked into getting the relevant pieces separate, but it's a pretty big workbook. But here is (I think all of) the relevant code (just):
The data is set up, so that all city names for a state are in a range NAMED with the state. So all California cities are in a range -called- "California." This makes populating boxCity as easy as:
This is current behaviour:
1. I choose "California" in boxState.
~ displayed in boxState: California
~ displayed in boxCity : <blank>
2. boxCity is populated with a range named "California" - all the cities in California
~ displayed in boxState: California
~ displayed in boxCity : <blank>, but on clicking the drop-down, all cities in California
3. I choose a California city (now boxCity combobox is displaying this city)
~ displayed in boxState: California
~ displayed in boxCity : San Francisco (for example)
4. I choose Florida in boxState
~ displayed in boxState: Florida
~ displayed in boxCity : San Francisco (should be empty!!), but on clicking the drop-down, all cities in Florida
5. boxCity REMAINS displaying the chosen California city
~ displayed in boxState: California
~ displayed in boxCity : San Francisco (user can currently submit userform with a non-matching city / state combo!!)
This would allow a user to submit a record with a city that doesn't exist in the state they chose! I don't how to clear the previously chosen value being displayed in the boxCity combobox.
The following does not work:
How can I clear the data currently entered in boxCity when I choose another Value in boxState?
Bookmarks