I need to store IDs that have letters in them (e.g. 345H12A) in list boxes. I've used the ItemData field in the past to store numeric data, but I how can I store a combination of numbers and letters?
Printable View
I need to store IDs that have letters in them (e.g. 345H12A) in list boxes. I've used the ItemData field in the past to store numeric data, but I how can I store a combination of numbers and letters?
Add them as strings in code
VB Code:
Listbox1.Additem "Your text here"
Mega.
I guess I need to clarify things. I'm trying to store BOTH a name (e.g. "John Davis") and and an associated ID with numeric and non-numeric characters (e.g. "A566T2", which is John Davis' ID) in a list box. With a numeric ID, I can store the name with the additem method and store the ID with the ItemData method but I can't do that in this case because of the letters in the ID. Is there some way I can add the name AND the ID in the case?
Using a listbox is not the way to do this. If you must use any type of list in this fashion, then use a listview. You can then have the name in the first column and the ID in the second column. You can then reference them independently.
Mega.