I have a combobox with two colunms, but the first is hidden that adds values onto a listbox in the same manner. I am noticing that the list box is truncating the string in the second column.
This is my code thus far where cmbPart is the combobox and lstPart is the listbox.
Me.lstPart.AddItem (CStr(Me.cmbPart.Value) & " ;" & CStr(Me.cmbPart.Column(1, Me.cmbPart.ListIndex)))
I notice that that when there is a comma (,) in the string it stops displaying the rest from Me.cmbPart.Column(1, Me.cmbPart.ListIndex)
.
How can I stop the behavior?
Aperently strings with commas in to be added to a multicolunm listbox bust be enclosed in single quotes.
Me.lstPart.AddItem (CStr(Me.cmbPart.Value) & " ;" & CStr("'" & Me.cmbPart.Column(1, Me.cmbPart.ListIndex)) & "'")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With