tag:blogger.com,1999:blog-8467396942183518214.post5831343791663800016..comments2022-03-24T20:19:44.253-04:00Comments on My MS Access Blog: My Treeview Project | Episode Two: Northwind Categories and ProductsStephenhttp://www.blogger.com/profile/13190848153946763046noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-8467396942183518214.post-11337838925514184462009-06-17T04:32:50.912-04:002009-06-17T04:32:50.912-04:00Great tutorial - I've been working on a TreeVi...Great tutorial - I've been working on a TreeView and some information here has just helped me overcome an issue I was having. Thanks!Unknownhttps://www.blogger.com/profile/03978044210127909574noreply@blogger.comtag:blogger.com,1999:blog-8467396942183518214.post-5831079998436981742009-05-13T09:55:00.000-04:002009-05-13T09:55:00.000-04:00Hi Guys,
Im very much a novice in here. I have ma...Hi Guys,<br /><br />Im very much a novice in here. I have managed to use this code and develop something similar to what we have here and I thank you very much for that. I need to go one more step forward to add another level to the tree using a thrid table which is related to the second table using a one-many relationship. Can someone help me with this , great favourSanjayahttps://www.blogger.com/profile/05033827656890063463noreply@blogger.comtag:blogger.com,1999:blog-8467396942183518214.post-6931887149075497262009-03-31T15:43:00.000-04:002009-03-31T15:43:00.000-04:00Great tutorial.I try to use treeview but i receive...Great tutorial.I try to use treeview but i receive an error: "Run time error 35601 element not found".I don't know what is wrong.can you help me?I have 2 tables: Clienti with Columns: ClientId,Nume<BR/>and Comenzi table with columns: ComandaId,ClientId. and code:<BR/>Private Sub CreateCategoryNodes()<BR/> Dim rst As DAO.Recordset ' recordset for category data<BR/> <BR/> ' open the recordset for categories<BR/> Set rst = CurrentDb.TableDefs!Clienti.OpenRecordset<BR/> <BR/> ' loop through the rows in the recordset<BR/> rst.MoveFirst<BR/> Do Until rst.EOF<BR/> Me.xProductTreeview.Nodes.Add Text:=rst!nume, _<BR/> Key:="Cat=" & CStr(rst!ClientId)<BR/> rst.MoveNext<BR/> Loop<BR/> rst.Close<BR/> Set rst = Nothing<BR/>End Sub<BR/><BR/>Private Sub CreateProductNodes()<BR/> Dim rst As DAO.Recordset ' recordset for product data<BR/> <BR/> ' open the recordset for products<BR/> Set rst = CurrentDb.TableDefs!Comenzi.OpenRecordset<BR/> <BR/> ' loop through the rows in the recordset<BR/> rst.MoveFirst<BR/> Do Until rst.EOF<BR/> Me.xProductTreeview.Nodes.Add Relationship:=tvwChild, _<BR/> Relative:="Cat=" & CStr(rst!ClientId), _<BR/> Text:=rst!ComandaID, Key:="Prod=" & CStr(rst!ComandaID)<BR/> rst.MoveNext<BR/> Loop<BR/> rst.Close<BR/> Set rst = Nothing<BR/>End Sub<BR/><BR/>Private Sub Form_Open(Cancel As Integer)<BR/> CreateCategoryNodes<BR/> CreateProductNodes<BR/>End Sub<BR/>The error is when it add the child nodeUnknownhttps://www.blogger.com/profile/12282170329130808487noreply@blogger.comtag:blogger.com,1999:blog-8467396942183518214.post-10642067639845496472009-03-01T11:10:00.002-05:002009-03-01T11:10:00.002-05:00Darrell,Make sure you name the treeview control xP...Darrell,<BR/>Make sure you name the treeview control xProductTreeview.<BR/><BR/>JackUnknownhttps://www.blogger.com/profile/04211173209613515345noreply@blogger.comtag:blogger.com,1999:blog-8467396942183518214.post-22039290049274672262009-02-02T15:41:00.000-05:002009-02-02T15:41:00.000-05:00When I posted the code into the form module, in th...When I posted the code into the form module, in the line: <I>Me.xProductTreeview.Nodes.Add Text:=rst!CategoryName, _<BR/> Key:="Cat=" & CStr(rst!CategoryID)</I><BR/><BR/>rst!CategoryID would not compile.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8467396942183518214.post-63705195749821021212008-09-16T21:18:00.000-04:002008-09-16T21:18:00.000-04:00ter-o-retik: you're right- I;ve seen some neat exa...ter-o-retik: you're right- I;ve seen some neat examples where a query is constructed that pulls the parent and child data together, allowing one pass through the query's recordset to create all the nodesStephenhttps://www.blogger.com/profile/13190848153946763046noreply@blogger.comtag:blogger.com,1999:blog-8467396942183518214.post-35262769106981829252008-09-16T21:15:00.000-04:002008-09-16T21:15:00.000-04:00Ricardo- you're right, sir, and I;ve fixed the pos...Ricardo- you're right, sir, and I;ve fixed the post. Thanks for the catch!Stephenhttps://www.blogger.com/profile/13190848153946763046noreply@blogger.comtag:blogger.com,1999:blog-8467396942183518214.post-61132351341613721642008-07-18T08:28:00.000-04:002008-07-18T08:28:00.000-04:00I think that using Queryes instead of Tables is wo...I think that using Queryes instead of Tables is worth mentioning.<BR/>I meen code like <BR/>"Set rst = CurrentDb.QueryDefs!QueryX.OpenRecordset"<BR/>By using queryes you can store you tree structure in one table (fields like CategoryName; CategoryID; Level; ParentID). <BR/>Query example: <BR/>SELECT Table1.CategoryName, Table1.Code, Table1.ParentCode<BR/>FROM Table1<BR/>WHERE (((Table1.Level)="2"));Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8467396942183518214.post-61304834108744345372008-05-24T17:31:00.000-04:002008-05-24T17:31:00.000-04:00This is a great tutorial. I just want to mention ...This is a great tutorial. I just want to mention that in the piece of code,<BR/><BR/>Me.xProductTreeview.Nodes.Add Relationship:=tvwChild, _<BR/> Relative:="Prod=" & CStr(rst!CategoryID), _<BR/> Text:=rst!ProductName, Key:="Prod=" & CStr(rst!ProductID)<BR/><BR/>I believe the line that reads<BR/>Relative:="Prod=" & <BR/>should read like<BR/>Relative:="Cat=" &Ricardohttps://www.blogger.com/profile/13905967483463739839noreply@blogger.com