Search related table with Combobox selection

ziggy1971

New member
Joined
Dec 1, 2009
Messages
1
Programming Experience
Beginner
Hello all,
I have 2 related tables, the first table is called "Artist", the second is "Albums". The relationship is a 1-to-many, where 1 Artist has many Albums, therefore the Primary and Foreign keys are ArtistID in both tables.

What I'm trying to do is display all the Artists in a combobox and then display the related Albums in a listbox.

When the user selects an Artist from the combobox, I want to use the ArtistID to search for all the related Albums, however, I don't know how to set up the query to use the ArtistID to find the Albums from the second table.

I used a DataTable and the .DataSource property of the ComboBox to display the Artists.

This is my first attempt at a multi-table query, so please bear with me if this seems simple. :eek:

Any advice, or even an example of how to do this is greatly appreciated,
Thanx,
Cheers,
ziggy1971 :cool:
 
See the DW2 link in my signature, sections about displaying related data. You might ahve to start with some simpler tutorials first, such as Creating a Simple Data App

Don't fill all the albums at once.. Only fill them each time the artist changes. (this will make more sense later)
 
Back
Top