Results 1 to 5 of 5

Thread: How Do I popluate a Listbox with Data?

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    8

    How Do I popluate a Listbox with Data?

    Hi all, I need help populating a listbox with data from a database. what I'm trying to do is make a list box that shows all records with the "Date" field along with the FName and LName fields.. it's a project for a class, and it's a Dr. office program that keeps patient records.. I want to have it display all appointments for a single person. i have no code.. but all i can think of is binding it to the ADODC control on the form but that dont work.

  2. #2
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: How Do I popluate a Listbox with Data?

    If its for a class your tutor should of given you some help? Anway there is a great tutorial about this here:
    http://www.vbforums.com/showthread.p...t=ado+tutorial
    Chris

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    8

    Re: How Do I popluate a Listbox with Data?

    yeah... I read the tutorial.. I'm just trying to figure out how to populate the listbox..with the 3 fields i want based on the ID number field in the same table. so when i have a particular record visible on the form.. it shows all the different entried of the fields for the same person.. like a appointment history should.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How Do I popluate a Listbox with Data?

    First, a listbox is not real good for anything more than one field (and before everyone jumps all over me for saying that, you all know as well as I that to extract something from a listbox that contains more than one entry on a single line requires string parsing, and do we really want to get into that here?)

    I would suggest using a ListView rather than a Listbox. Is a Listbox a requirement of your class?

  5. #5
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    790

    Re: How Do I popluate a Listbox with Data?

    In either case you need to call a stored procedure to populate the listbox or the listiview. look in my thread the vb nightmare above it cover with the help of the fine people here how to populate a listview several of them actually on a tab dialog control.

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