Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tree View Control with Table as a switchboard Form

Status
Not open for further replies.

esengul

Instructor
Dec 9, 2004
59
US
Hi
I have a table for each subforms object.
CatTable
===========
CatID CatName ParentID ParLvl FrmName
1 CatName1 0 0
2 CatName2 1 1 FrmCatName2
3 CatName3 1 1
4 CatName4 3 2 FrmCatName24
============
I want to create a tree view control shows my record in this table

F.E
CatName1
CatName2 (click event opens the form as my subform)
CatName3
CatName4 (click event opens the form as my subform)

I tried it with many ways but i couldn't do it. Please let me know how i can do it. I hope i explained it very clearly, if not let me know.
Thanks in advance
 
Hey MajP
I have another question regarding to tree view control. I have a text box on he form. when the user types the node name, it will select the node automaticly
here is my code:
Private Sub cmdFind_Click()
Dim catname As String
Dim catid As Integer
catname = Me.txtCatName
catid = DLookup("CategoryID", "dbo_tblCategory", "CategoryName = '" & catname & "'")
Me.xTree.SetFocus
Me.xTree.SelectedNode.Tag = "a" & catid
end sub
with this code i am getting "Object doesnt support this property or method" on the line "me.xtree.SelectedNode.tag"

Let me know what i am doing wrong
Thanks
 
I got It here is the code
Dim catname As String
Dim catid, intcount As Integer
catname = Me.txtCatName
catid = DLookup("CategoryID", "dbo_tblCategory", "CategoryName = '" & catname & "'")
catid = "a" & catid
Me.xTree.SetFocus
For intcount = 1 To xTree.Nodes.Count
xTree.Nodes(intcount).Expanded = False
If catid = xTree.Nodes(intcount).Key Then
xTree.Nodes(intcount).Selected = True
End If
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top