[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
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.