Link to home
Start Free TrialLog in
Avatar of Zaurb
Zaurb

asked on

VB. NET Data Binding: How to drill down with listboxes and comboboxes

Hi!

I have two tables as in the attached images and I've configured a dataset as in the query below. Form I'm trying to build is also in the attached image.

What I need to do is to drill down to [Descrizione Guasto] by making selection from two preceding listboxes. Let's say if user selects some value in Tipologia (which has to be DISTINCT... but now it's not) then the [Descrizione Categoria] is filtered out according to this. After selecting [Descrizione Categoria] user will be presented with the filtered out rows in the [Descrizione Guasto] combobox.

1) How do I make a databound listbox display only distinct values in this scenario?
2) How do I tie all these controls together?

Many thanks in advance!
SELECT  d.[Guasto ID], 
		d.[Descrizione Guasto], 
		d.[Categoria Guasto], 
		c.[Descrizione categoria], 
		c.Tipologia, 
		c.[Codice categoria]
FROM	tblCategorieGuasto AS c INNER JOIN
        tblCodiciGuasto AS d ON c.[Codice categoria] = d.[Categoria Guasto]

Open in new window

tblCategorieGuasto.png
tblCodiciGuasto.png
frmRiparazione.png
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Zaurb
Zaurb

ASKER

Thank you!