I have discovered a very odd interaction and I am hoping someone can explain to me why it is happening.
I have some code in a userform that populates comboboxes with values if you select a line of data from a list box and click on edit.
One combobox populates with strictly numbers, all the others are text based. No matter what I did, that one combobox in particular would not populate if I had the style as fmStyleDropDownList. It works fine if I change it to fmStyleDropDownCombo, but that opens the door to have user input error of data that isn't compatible which means more work coding a check to ensure the value is allowed.
On a hunch I tried going to the source of the list, and adding an ' in front of each number to convert them to text, and low and behold the combobox now populates fine with the fmStyleDropDownList style.
My question is why does it stop working and give a value error, or simply fail to populate the combobox if the data are numbers rather than text?
I have some code in a userform that populates comboboxes with values if you select a line of data from a list box and click on edit.
One combobox populates with strictly numbers, all the others are text based. No matter what I did, that one combobox in particular would not populate if I had the style as fmStyleDropDownList. It works fine if I change it to fmStyleDropDownCombo, but that opens the door to have user input error of data that isn't compatible which means more work coding a check to ensure the value is allowed.
On a hunch I tried going to the source of the list, and adding an ' in front of each number to convert them to text, and low and behold the combobox now populates fine with the fmStyleDropDownList style.
My question is why does it stop working and give a value error, or simply fail to populate the combobox if the data are numbers rather than text?