Xkape Posted October 11, 2003 Posted October 11, 2003 Hello all, I am working on a database and I have a combo box being filled with data from one of the tables in my AccessDB. And I am wanting to select from the combo box and fill a listbox with what matches the data in the database, ex. Select artist in combo box and have the albums for that artist fill the listbox. So i'm guessing that I don't have my select statement right. This is all I have Qry.CommandText = "SELECT AlbumName FROM Albums" I do understand that this statement will fill all albums into the listbox, I am just trying to get the data per artist to fill the listbox. All help appreciated. Thanks, J Quote
*Gurus* Derek Stone Posted October 12, 2003 *Gurus* Posted October 12, 2003 The following will return albums recorded by a specified artist: Command.CommandText = "SELECT AlbumName FROM Albums WHERE Artist = '" & ComboBox.SelectedText & "'" Quote Posting Guidelines
Xkape Posted October 14, 2003 Author Posted October 14, 2003 Thanks for the reply I finally got it figured out. Here is the statment I used to make it work "SELECT Albums.AlbumName FROM Artist_List INNER JOIN (Albums INNER JOIN Artist_Album_Link ON Albums.AlbumID = Artist_Album_Link.AlbumID) ON Artist_List.ArtistID = Artist_Album_Link.ArtistID WHERE Artist_List.ArtistName = '" & cmbArtist.Text & "'" However I have decided I'm going perform the function with a Dataset instead. Again thanks J Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.