Results 1 to 2 of 2

Thread: TreeView Control Query

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Location
    London, England
    Posts
    213

    Post

    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 ?

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    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
    Code:
    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

    [email protected]
    A BMW Group Company

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width