bdsii
10-31-2009, 08:54 AM
Any help would be appreciated. :yes
I have a simple userform where the user would select the Street on the first combobox. Based on the selection in the first combobox, the user could select the Address in the second combobox. The Address combo box would be limited to only those addresses that match the street selected in the street combo box. Once the address combo box has been selected, some code would then populate the textbox Name with the value in the Name field.
I am attaching a sample file with the userform and current code I have cobbled together. If improvements can be made to the code populating the comboboxes that could be appreciated too.
One issue is that for the street combobox, I would only want to see one instance of each street name, not one instance for each time it appears in the data. For example if there are 5 instances of an address on the street named Alpha, I would want to only see Alpha one time in the street combobox.
If it is possible to sort the items populating the comboboxes so they would be in alphanumeric order that would help if items are added at the end of the source data in a random order. I suppose I could sort the source data before initializing and loading the comboboxes but if there is code to help with that in the load process that may work better.
I am not certain this sample requires a combobox versus a listbox. In a later sub I want to utilize the variables and data selected here so if it is easier to use a listbox then I can switch to listboxes versus comboboxes.
I really have no idea how to populate the Name textbox and have left that sub blank for the code I need.
Ideas / Suggestions ?
thanks!
I have a simple userform where the user would select the Street on the first combobox. Based on the selection in the first combobox, the user could select the Address in the second combobox. The Address combo box would be limited to only those addresses that match the street selected in the street combo box. Once the address combo box has been selected, some code would then populate the textbox Name with the value in the Name field.
I am attaching a sample file with the userform and current code I have cobbled together. If improvements can be made to the code populating the comboboxes that could be appreciated too.
One issue is that for the street combobox, I would only want to see one instance of each street name, not one instance for each time it appears in the data. For example if there are 5 instances of an address on the street named Alpha, I would want to only see Alpha one time in the street combobox.
If it is possible to sort the items populating the comboboxes so they would be in alphanumeric order that would help if items are added at the end of the source data in a random order. I suppose I could sort the source data before initializing and loading the comboboxes but if there is code to help with that in the load process that may work better.
I am not certain this sample requires a combobox versus a listbox. In a later sub I want to utilize the variables and data selected here so if it is easier to use a listbox then I can switch to listboxes versus comboboxes.
I really have no idea how to populate the Name textbox and have left that sub blank for the code I need.
Ideas / Suggestions ?
thanks!