By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,363 Members | 2,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,363 IT Pros & Developers. It's quick & easy.

Data from one table to populate a VB TreeView

P: 32
I have a table with the following columns, ID (A unique value) Style#, Color, Size (There a more columns than that, but those are the ones I will need for this exercise.)

There is a row for each Style#, in every Color, and every Size. (e.g.:
Rec1) Style A, White, Small
Rec2) Style A, White, Med
Rec3) Style A, White, Large
Rec4) Style A, Black, Small
Rec5) Style A, Black, Med
Rec6) Style B, White, Small
Rec7) Style B, Black, Large


I want to populate the TreeView by Style, then Color, then Size. As evidenced by the sample data above, there can be sizes, colors available in one style, that are not available in another, etc.

I have thus far been able to extract data to populate the first two nodes on the control, but breaking out the sizes by color, is proving to be slightly beyond the reach of my present abilities.

I know I will probably need a Group By clause, but whenever I try to nest SELECT statements with Group By, I get an error!

Anyone have a suggestion?
Mar 17 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.