Results 1 to 4 of 4

Thread: Storing a non-numeric ID in a list box

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Austin, TX
    Posts
    77

    Storing a non-numeric ID in a list box

    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?

  2. #2
    Frenzied Member Mega_Man's Avatar
    Join Date
    Mar 2001
    Location
    North of England, South-East of Iceland
    Posts
    1,067
    Add them as strings in code
    VB Code:
    1. Listbox1.Additem "Your text here"

    Mega.
    "If at first you don't succeed, then skydiving is not for you"

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Austin, TX
    Posts
    77
    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?

  4. #4
    Frenzied Member Mega_Man's Avatar
    Join Date
    Mar 2001
    Location
    North of England, South-East of Iceland
    Posts
    1,067
    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.
    "If at first you don't succeed, then skydiving is not for you"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width