linux_s2002
Registered User.
- Local time
- Today, 13:26
- Joined
- Sep 20, 2017
- Messages
- 21
Hi,
I have a resultset like this:
|stars|idR|idS|idU|
|---|--- | ---|---|
|5 | | | |
|5 | 1 | 3 | 0 |
|5 | 1 | 4 | 0 |
|5 | 2 | 27 | 1 |
|5 | 2 | 30 | 0 |
|5 | 3 | 33 | 0 |
|5 | 3 | 33 | 1 |
|5 | 3 | 33 | 2 |
|5 | 3 | 33 | 3 |
How can I populate treeview with this fields?
The result i want is like this:
+5
+1
+3
+4
+2
+27
+1
+30
+3
+33
+1
+2
+3
I try with this code:
Set rstBlq = dbs.OpenRecordset(S1)
If Not rstBlq.EOF And Not rstBlq.BOF Then
Do While Not rstBlq.EOF
i = i + 1
If rstBlq.Fields(1) & "" = "" Or rstBlq.Fields(1) = 0 Then
Else
sKy = DLookup("desc", "R", "IDR=" & rstBlq.Fields(1))
Set cNode = cRoot.AddChild(sKey:=rstBlq.Fields(1) & " 5\_" & i + 1,vCaption:=(sKy))
If rstBlq.Fields(2) & "" = "" Or rstBlq.Fields(2) = 0 Then
Else
sKy2 = DLookup("desc", "S", "IDS=" & rstBlq.Fields(2) & " and idR=" & rstBlq.Fields(1))
Set cNode2 = cNode.AddChild(sKey:=rstBlq.Fields(2) & " 5\_" & i + 1000,vCaption:=(sKy2))
If rstBlq.Fields(3) & "" = "" Or rstBlq.Fields(3) = 0 Then
Else
sKy3 = DLookup("desc", "U", "IDU=" & rstBlq.Fields(3) & " and idS= " & rstBlq.Fields(2))
Set cNode3 = cNode2.AddChild(sKey:=rstBlq.Fields(3) & " 5\_" & i + 10000,vCaption:=(sKy3))
End If
End If
cNode.Expanded = False
End If
rstBlq.MoveNext
Loop
Set cNode3 = Nothing
Set cNode2 = Nothing
Set cNode = Nothing
End If
but don't work
thanks!!
I have a resultset like this:
|stars|idR|idS|idU|
|---|--- | ---|---|
|5 | | | |
|5 | 1 | 3 | 0 |
|5 | 1 | 4 | 0 |
|5 | 2 | 27 | 1 |
|5 | 2 | 30 | 0 |
|5 | 3 | 33 | 0 |
|5 | 3 | 33 | 1 |
|5 | 3 | 33 | 2 |
|5 | 3 | 33 | 3 |
How can I populate treeview with this fields?
The result i want is like this:
+5
+1
+3
+4
+2
+27
+1
+30
+3
+33
+1
+2
+3
I try with this code:
Set rstBlq = dbs.OpenRecordset(S1)
If Not rstBlq.EOF And Not rstBlq.BOF Then
Do While Not rstBlq.EOF
i = i + 1
If rstBlq.Fields(1) & "" = "" Or rstBlq.Fields(1) = 0 Then
Else
sKy = DLookup("desc", "R", "IDR=" & rstBlq.Fields(1))
Set cNode = cRoot.AddChild(sKey:=rstBlq.Fields(1) & " 5\_" & i + 1,vCaption:=(sKy))
If rstBlq.Fields(2) & "" = "" Or rstBlq.Fields(2) = 0 Then
Else
sKy2 = DLookup("desc", "S", "IDS=" & rstBlq.Fields(2) & " and idR=" & rstBlq.Fields(1))
Set cNode2 = cNode.AddChild(sKey:=rstBlq.Fields(2) & " 5\_" & i + 1000,vCaption:=(sKy2))
If rstBlq.Fields(3) & "" = "" Or rstBlq.Fields(3) = 0 Then
Else
sKy3 = DLookup("desc", "U", "IDU=" & rstBlq.Fields(3) & " and idS= " & rstBlq.Fields(2))
Set cNode3 = cNode2.AddChild(sKey:=rstBlq.Fields(3) & " 5\_" & i + 10000,vCaption:=(sKy3))
End If
End If
cNode.Expanded = False
End If
rstBlq.MoveNext
Loop
Set cNode3 = Nothing
Set cNode2 = Nothing
Set cNode = Nothing
End If
but don't work
thanks!!