Contextafhankelijke sub-categorie

Status
Niet open voor verdere reacties.
De oplossing was eigenlijk een groot deel overbodige code weglaten ;)

Code:
Option Compare Database
Option Explicit
Dim strSQL As String
Dim i As Integer

Private Sub cboCat1_AfterUpdate()


strSQL = "SELECT tCategorie.CatID, tCategorie.Naam, tCategorie.ParentID, Count(SubCat.CatID) AS AantalSub " _
    & "FROM tCategorie " _
    & "LEFT JOIN tCategorie AS SubCat ON tCategorie.CatID = SubCat.ParentID " _
    & "WHERE (tCategorie.ParentID = " & Me.cboCat1 & ") " _
    & "GROUP BY tCategorie.CatID, tCategorie.Naam, tCategorie.ParentID " _
    & "ORDER BY tCategorie.Naam;"

Me.cboCat2.RowSource = strSQL
Me.cboCat2.Requery
Me.cboCat3.RowSource = strSQL
Me.cboCat3.Requery
End Sub
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan