Results 1 to 2 of 2

Thread: [RESOLVED] Populate listbox based on selection from another listbox

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2016
    Posts
    1,415

    Resolved [RESOLVED] Populate listbox based on selection from another listbox

    Hi Everyone,

    I have in my database a table and just for simplicity in order to ask the question lets say the table name is "Food Types" in the food types table I list e.g. veggies, fruit. Then I have another table "Foods" These two tables are related. I have 2 datagrids in my form. If I select "veggies" in the fist grid the second grid displays "carrots, peas, pumpkin" etc.. If I select "fruit" in the first grid the 2nd grid displays "grapes, pears, apples" etc.. All this works fine. But I would rather have two listboxes to do this. If I click in the fist listbox on veggies, the second listbox must display accordingly. I would also want to be able to have a add/delete button for each of these listboxes. I know this question is a mouth full, but can someone maybe just point me in the right direction or some tutorial I can follow?

    My level of experience: Beginner

    Kind Regards,
    Michelle

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,297

    Re: Populate listbox based on selection from another listbox

    You should use master/detail data-binding, for both the grids and the ListBoxes. Follow the CodeBank link in my signature below and check out my thread on the subject to learn how.

Tags for this Thread

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