Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub Form_Load()
'Build the Nodes for the TreeView Control
With MyTreeView.Nodes
'Parent node
.Add , , "QAPARENT", "QA Team", "img1"
'Child nodes
.Add "QAPARENT", tvwChild, , "Bug Input", "img2"
.Add "QAPARENT", tvwChild, "VIEWBUG", "View Bugs", "img3"
'Parent node
.Add , , "DEVPARENT", "Dev Team", "img4"
'Chile nodes
.Add "DEVPARENT", tvwChild, , "Statistics", "img1"
.Add "DEVPARENT", tvwChild, , "Find", "img2"
.Add "DEVPARENT", tvwChild, , "Tasks", "img3"
End With
End Sub
Sub RemplirTreeview()
' définition des variables
Dim RSEntites As DAO.Recordset
Dim txtSQL As String
Dim j As Integer
Dim mynode As Node
' ouverture de la requête du formulaire en cours
Set mabase = CurrentDb
txtSQL = "SELECT * FROM R_Entite_triee;"
Set RSEntites = mabase.OpenRecordset(txtSQL, dbOpenSnapshot)
' instanciation de l'objet treeview
Set trwArbo = Me.TV1.Object
With trwArbo
.Nodes.Clear
.ImageList = Me.ImageList1.Object
.HideSelection = False
.LineStyle = tvwRootLines
End With
'remplissage du treeview avec le contenu de la requête
Do While Not RSEntites.EOF
'niveau1
If IsNull(RSEntites![N°entiteS]) = True Then
Set mynode = trwArbo.Nodes.Add(, , "O" & RSEntites![N°Entite], RSEntites![Entite], "IMG_FOLD")
'mynode.Bold = True
'mynode.ForeColor = RGB(98, 162, 197)
Else
'niveaux2 à 4
Select Case Left(RSEntites![TypeEntite], 1)
Case 2
trwArbo.Nodes.Add "O" & RSEntites![N°entiteS], tvwChild, "O" & RSEntites![N°Entite], RSEntites![Entite], "IMG_FOLD"
Case 3
trwArbo.Nodes.Add "O" & RSEntites![N°entiteS], tvwChild, "O" & RSEntites![N°Entite], RSEntites![Entite], "IMG_FOLD"
Case 4
trwArbo.Nodes.Add "O" & RSEntites![N°entiteS], tvwChild, "O" & RSEntites![N°Entite], RSEntites![Entite], "IMG_PICK"
End Select
End If
RSEntites.MoveNext
Loop
'libération du recordset
Set RSEntites = Nothing
End Sub