PDA

Click to See Complete Forum and Search --> : TreeView Control Query


nmretd
Dec 12th, 1999, 05:44 PM
I am using an Access Table to populate the nodes on my TreeView control. i.e:

For indx = Asc("A") To Asc("Z")
currentAlpha = Chr(indx)

Set MyNode = TreeView1.Nodes.Add _
(, , currentAlpha, currentAlpha)


This works fine but some of the nodes are empty, i.e they are not expandable.

How can I make these nodes invisible to the user ?

Mark Sreeves
Dec 12th, 1999, 06:02 PM
You say that you are populating the treeView from a database table.

Can't you constuct the treeview from a select statement on that same table

eg

Dim strSQL As String
Dim rstTemp As Recordset

strSQL = "SELECT Left([tblName]![Name],1) AS Expr1 From tblName " & _
"GROUP BY Left([tblName]![Name],1)" & _
"ORDER BY Left([tblName]![Name],1);"

Set rstTemp = db.OpenRecordset(strSQL)
With rstTemp
While Not .EOF
Set MyNode = TreeView1.Nodes.Add _
(, , !expr1, !expr1)
.MoveNext
Wend
End With
rstTemp.Close

End Sub


------------------
Mark Sreeves
Analyst Programmer

Mark.Sreeves@Softlab.co.uk
A BMW Group Company